87

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.

2
  • 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, 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.
    – Luc
    Nov 17, 2014 at 17:35

1 Answer 1

208

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.

11
  • 77
    ...That is evil.
    – Pillgram
    Feb 15, 2015 at 21:31
  • 21
    Very 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.
    – Luc
    Nov 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
    Do this in a minimised js file, and watch his world burn.
    – Stender
    Jan 22, 2018 at 12:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.