IndexOf
Back to
a
variable. Also this time there is a lot of text: WAT?let a = 0; a = a - "Strings can help to increment our variable with this number:".indexOf('1') // a = 1
Baseball bat
This is first time when variable name isn’t
a
: WAT?let baseball_bat = 0; baseball_bat += 0==[[[[[[]]]]]] // BONK! baseball_bat = 1
unDEfined
This one is more complex:
WAT?let a = 0; a = a + (""+a[a])[3].charCodeAt() - (""+a[a])[2].charCodeAt(); // a = 1
Simple math
Okay, here we go!
First example is really tiny. Well, it’s still weird.
WAT?let a = 0; a -=- 1; // a = 1