unDEfined
This one is more complex:
Explanation
At first sight this one connected with strings — charCodeAt()
and ""
are markers for it.
What exactly happens here?
a[a]
returnundefined
. Logically using number as array is crazy but JS can endure it.""+a[a]
return"undefined"
but as string!- Finally, we get third and fourth letter from undefined,
get their codes (
charCodeAt()
will return number) and subtract them!
That’s it. This code can be changed a bit because we have more than one possible combination of consecutive letters.