I got a const
in meteor containing color
and text
variables:
const exampleTemplate = (text, color) => ('
Hello, this is your text:
${text}.
I hope you liked it. And here comes your color:
<span style="color: ${color}">Boom, here she is.</span>
');
const defaultColor = '#123456';
const firstColor = '#876543';
const secondColor = '#295736';
return exampleTemplate('I am a text example', defaultColor);
How can I define defaultColor
as default if no other var is set? I have found this thread but I am not able to adopt its markup. I want to use defaultColor
if the const color
is null
, false
, 0
, NaN
or ""
.