Skip Navigation
Javascript is the most popular scripting language in use today

Explanation: it's mostly due to how js does type conversion. for the Ls, it's >[] is an empty array >![] is treated as false >combining a boolean with the empty array returns "false" as a string (so true + [] = "true", false + [] = "false") >! + [] is treated as true >! + [] + ! + [] is treated as 2 since true + true = 1 + 1 = 2 >so you have "false"[2], which is l for the o it's >[] is an empty array >[] + {} returns "[object Object]" as a string ({} + [] returns 0) >![] is false >!![] is true >+!![] casts it to an integer >so that part is "[object Object]"[1], which returns "o"

22
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)TH
theopold @lemmy.world
Posts 2
Comments 2