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
  • 3,651
  • 3
  • 16
  • 39
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
  • 313,535
  • 40
  • 245
  • 254
1

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

;

Adrian
  • 7,768
  • 2
  • 23
  • 39
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
  • 3,651
  • 3
  • 16
  • 39