4 ms·
I prefer something like this before building the template string. image = post.image_urls?[0] || ""; Then have the printImage function return an empty string
by econ 2y ago
I prefer something like this before building the template string.
image = post.image_urls?[0] || "";
Then have the printImage function return an empty string if the argument is an empty string.
${printImage(image)}
Easier on the eyes.