const customImage = tmpl.customImage ? tmpl.customImage.map(c => c.url) : "https://yourl img here";
here tmpl.customImage is getting empty array[] so i want to display a default image instead of empty. But it is not fetching to default image it is showing empty...
Please help me thanks in advance
How about checking it length?
const customImage = tmpl.customImage.length ? tmpl.customImage.map(c => c.url) : "https://yourl img here";
use instead of that:
const customImage = tmpl.customImage.length ? tmpl.customImage.map(c => c.url) : "https://yourl img here";
give your image url link in that array make that variable and use res.render to render your file