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.
79
votes
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
@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
1 Answers
194
votes
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.
Disclaimer: I take no responsibility for any harm caused by this prank. Have fun!