JavaScript-Truthy and Falsy Assignment

let tool = '';

tool = 'marker';

// Use short circuit evaluation to assign writingUtensil variable below:

let writingUtensil = tool || 'pen';

console.log(`The ${writingUtensil} is mightier than the sword.`);

I do not really understand how this happen. Could you please explain. Thank you…

Hey!
Are you talking about why the console.log won’t work? If so, you’ve forgotten your backticks
This is a backtick `
Your console.log() line should look like this

console.log(`The ${writingUtensil} is mightier than the sword.`);

Always remember to use backticks when using template literals (that’s ${writingUtensil} )
Hope this helps. Let me know if it doesn’t :slight_smile:

1 Like