I saw _=$=+[],++_+''+$
that evaluates to 10
in this question Why does ++[[]][+[]]+[+[]] return the string "10"?. ( http://jsfiddle.net/tVMqM/ ).
Can someone please explain me why?
I saw _=$=+[],++_+''+$
that evaluates to 10
in this question Why does ++[[]][+[]]+[+[]] return the string "10"?. ( http://jsfiddle.net/tVMqM/ ).
Can someone please explain me why?
Resolves to 1 (true) _=$=+[],++_
Converts it to a string +''
Adds 0 to string +$
Edit: More detail for first part...
Create variables _ and $ _=$=
Set variables equal to 0 +[]
Increment _ variable ++_
There's a pretty good explanation here. HackerNews has some great discussion on the topic here.
It's important to note that this isn't the integer 10, but rather the string "10".