5 ms·
Try it letter by letter. For instance, to get the string "a": (![]+[])[+[[+!+[]]]] Take the first part, `(![]+[])`. `![]` evaluates to `false`. Then `+[]
by mjhoy 13y ago
Try it letter by letter.
For instance, to get the string "a":
(![]+[])[+[[+!+[]]]]
Take the first part, `(![]+[])`. `![]` evaluates to `false`. Then `+[]` coerces false into a string, so the expression is `"false"`.
The rest of the expression (more complicated) evaluates to `[[1]]`, which will grab the `"a"` from `"false"`. Now why there is the extra surrounding brackets, I'm not sure, because `[1]` would have worked as well.
- bargl 13y agoIt looks like the generator is suboptimal, but still really cool. (![]+[])[+!+[]] evaluates to "a" as well. It looks like it turns it into an array twice. It goes +!+[] === 1 then [+!+[]] === [1] then +[[+!+[]]] === 1 then [+[[+!+[]]]] === [1]