JavaScript 恶作剧/笑话

你如何以一种难以察觉和修复的方式来恶作剧一个同事或朋友?最好使用 JavaScript,而且不需要安装任何程序。

45814 次浏览

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.