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.
-
9This question appears to be off-topic because it is about boring pranks replacing a stupid character that any decent editor would detect immediately.– adeneoNov 17, 2014 at 4: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.– LucNov 17, 2014 at 17:35
1 Answer
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.
-
77
-
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. Jul 7, 2015 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.– LucNov 12, 2015 at 2: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 Mar 17, 2017 at 19:09 -
22