Skip to content

Instantly share code, notes, and snippets.

@akouryy
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akouryy/65cf672f37086b47aaf2 to your computer and use it in GitHub Desktop.
Save akouryy/65cf672f37086b47aaf2 to your computer and use it in GitHub Desktop.
+[]; // 0
![]; // false
!![]; // true
[]._; // undefined
({}) // Object {}
+[]+""; // "0"
![]+""; // "false"
!![]+""; // "true"
[]._+""; // "undefined"
({})+""; // "[object Object]""
_=+[]; _++; _++; _++; _++; _++;
__=(({})+"")[_]; // "c"
_=+[]; _++;
___=(![]+"")[_]; // "a"
____=(!![]+"")[+[]]; // "t"
__+___+____; // "cat"
//////////おまけ//////////
[].constructor.constructor; // function Function() /// eval的なやつ
[]["constructor"]["constructor"]; // function Function()
Function("alert(0)"); /// alert(0)する関数
Function("alert(0)")(); /// alert(0)する
[]["constructor"]["constructor"]("alert(0)")(); /// alert(0)する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment