what is the difference between " and ` in JS?

Viewed 606

this is quite an easy question but is not obvious to me.

What is the difference between this:

function fesElsDeures(subject){ 
console.log(`just started doing my ${subject} `);
}

and this:

function fesElsDeures(subject){ 
console.log("just started doing my ${subject} ");
}

It seems that in the second option, my console does not recognise the subject as a different value.

Thanks!

2 Answers

Don't to be confuse with ' (Single quote) with ` (back-tick).

  • " is Double quotes,
  • ' is single quotes
  • ` is back-tick.

when you use back-tick, it allows you write multi line texts. Template literals

Related