88

How do you prank a coworker or friend in a way that's hard to notice and fix? Preferably in JavaScript, and without having install any programs.

nobody
  • 19,814
  • 17
  • 56
  • 77
Luc
  • 3,581
  • 3
  • 22
  • 24
  • 9
    This question appears to be off-topic because it is about boring pranks replacing a stupid character that any decent editor would detect immediately. – adeneo Nov 17 '14 at 04:07
  • @adeneo Actually, Sublime (a very popular code editor) will not detect this at all. As long as the code editor doesn't have a plugin like JShint, it should go undetected. – Luc Nov 17 '14 at 17:35

1 Answers1

211

Greek Question Mark - Semicolon Prank

(Tested in JavaScript)

Replace one or several semicolons in a coworker or friend's code with the Greek question mark:

;

(source: http://en.wikipedia.org/wiki/Question_mark#Greek_question_mark)

If you compare the two, they look exactly the same: ;;

The first ; is a greek question mark, and the second ; is a normal semicolon.

The Greek question mark throws a SyntaxError: Unexpected token ILLEGAL in JavaScript, and probably throws errors in other languages as well. Make sure you're saving the code file in Unicode/UTF-8.

yivi
  • 42,438
  • 18
  • 116
  • 138
Luc
  • 3,581
  • 3
  • 22
  • 24