0

For some reason the code I'm writing in VScode giving me an error. However if I copy and paste exactly the same code from Github it works perfectly fine. It really confuses me and I don't understand what is going on. Also if you take a look at the image. For some reason VScode won't Syntax highlight Javascript identifier ($) from my code however it highlights copy/pasted one. enter image description here

mmg
  • 1
  • 3
  • You're using the wrong quotes, replace the `'` with `. – Brian Lee Nov 24 '20 at 22:08
  • 1
    "For some reason the code I'm writing in VScode giving me an error" — That's a linter warning. – Quentin Nov 24 '20 at 22:09
  • You are using apostrophe `'` instead of backticks ` backticks are used for string interpolation in JS : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals – James L. Nov 24 '20 at 22:09
  • 1
    When you see something like this it's often best to see what the actual differences is. You assumed it's "exactly the same code" while a simple comparison would show that it is not, in fact, exactly the same. Little things mean a lot. – Dave Newton Nov 25 '20 at 00:38

0 Answers0