${ ... ...} not working on Atom

Hi,

I cannot seems to make ${ … … } work on atom.
Does anybody faces the same problem too ?

Here are my codes, please let me know if something is wrong.

Practice Exercise Q22

var price = 50;
var text = prompt(“What is your age?”);
var age = parseInt(text);

if (age < 12 || age > 67) {
console.log(‘You have to pay ${price} * 0.5 Euro.’);
}
else {
console.log(‘You have to pay ${price} Euro.’);
}

  </script>
</body>

You have to use different quotation mark.
You are using '' nut you should use ``

Example

const name = "Daniele"
console.log(`Hello ${name}`)
1 Like

I see. Thank you dan-i

1 Like

hi dan,

I have the same issue, stupid question, but where to find `` instead of " in Atom on OSX.

Thanks! :slight_smile:

Arnoud