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.
Asked
Active
Viewed 4.8k times
88
-
9This 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 Answers
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.
-
78
-
21Very easy to detect & fix. Usually if I don't know why I have an error at a certain line, I wipe the whole line and rewrite it. – Eduard Luca Jul 07 '15 at 14:26
-
-
3@JohnDemetriou Interesting. It must be converting from Unicode to an encoding that doesn't have the Greek Question Mark. That means it would turn the character into a semicolon before it compiles. – Luc Nov 12 '15 at 02:37
-
-
6@BrightIntelDusk An easy fix is the perfect type of fix for a prank though. I had a coworker replace `True = False` in a python django app. Code ran fine for the most part but it cost the guy a day of work – TankorSmash Mar 17 '17 at 19:09
-
-
22
-
1If using yarn and babel: modify the version of babel in the global yarn cache so that it writes the Greek question mark instead of semicolon. – Max Heiber Jan 28 '18 at 18:17
-
-
@BrightIntelDusk Sure, if they happened to read this exact answer. Otherwise, how would they know? – Anonymous Apr 02 '21 at 14:18