I explored this here: https://perchance.org/481tgbwo1k#edit
I can’t even guess as to what’s happening with some of this. Most bizarre…
I explored this here: https://perchance.org/481tgbwo1k#edit
I can’t even guess as to what’s happening with some of this. Most bizarre…
Also fun fact, lists on Perchance are actually made of custom objects, and so every single type of JavaScript objects is treated by the Perchance engine as “lists”. And since arrays are of objects, evaluating them directly will output a random item from the array, as if they’re lists, if you don’t know yet.
In addition,
[ ({}) ]
and[ [{}] ]
gives the same result ase = [ x = {} ]
.Ah yes, I’ve seen perchance is everywhere… which is cool sometimes, unless you don’t want it to be perchancing and then it’s a bloomin’ nightmare. 🤣 And if you know JS as I do, and come in here thinking you can do easy things… you’re probably going to bash your head against a brick wall from time to time until you can hack your way around it!
I could see why
[({})]
returns the same value as[x={}]
. Shouldn’t[[{}]]
return an array though? Or do you just mean in terms of it perchancing it so it gives you one of the array items at random and there’s only one array item so it (eventually evaluates to) the same thing?