0

Image

In the above fiddle, it says the semicolon at the end of the line is unexpected. How so?

alert('foo');

alert('bar');
Aryan Beezadhur
  • 4,503
  • 4
  • 21
  • 42
mfsg
  • 45
  • 6

3 Answers3

5

The character you have there is not a semicolon (character code 59), but a "Greek Question Mark", character code 894.

console.log(';'.charCodeAt()); // Greek
console.log(';'.charCodeAt()); // Normal

Use the regular ; semicolon instead.

CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
1

The character on the first line is not a semicolon, it's a Greek question mark.

;

Adrian
  • 8,271
  • 2
  • 26
  • 43
1

The first character is not actually a semicolon, it's a Greek question mark, U+037E / ; / ; / %CD%BE

Greek question mark: ;

Semicolon: ;

The difference is barely noticeable though.

This works:

alert('foo');

alert('bar');
Aryan Beezadhur
  • 4,503
  • 4
  • 21
  • 42