Skip to content

Instantly share code, notes, and snippets.

@sirpengi
Created September 4, 2014 22:28
Show Gist options
  • Save sirpengi/2131dfb79bbdc29f5240 to your computer and use it in GitHub Desktop.
Save sirpengi/2131dfb79bbdc29f5240 to your computer and use it in GitHub Desktop.
wtf javascript
var assert = require("assert");
assert.equal(
({lol: 'LOL', javascript: 'JAVASCRIPT'})['lol', 'wtf', 'javascript'],
"JAVASCRIPT"
);
assert.equal(
({lol: 'LOL', javascript: 'JAVASCRIPT'})[['javascript']],
"JAVASCRIPT"
)
assert.equal(
({lol: 'LOL', javascript: 'JAVASCRIPT'})[[[[[['javascript']]]]]],
"JAVASCRIPT"
)
var b = [[[[[[[[[['javascript']]]]]]]]]];
assert.equal(
({lol: 'LOL', javascript: 'JAVASCRIPT'})[b],
"JAVASCRIPT"
)
assert.equal(
({lol: 'LOL', javascript: 'JAVASCRIPT'})[[b]],
"JAVASCRIPT"
)
assert.equal(
({lol: 'LOL', javascript: 'JAVASCRIPT'})['lol', 'wtf', b],
"JAVASCRIPT"
)
@Leslie2014
Copy link

wtf...

@Leslie2014
Copy link

Best Riven CN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment