3 ms·
> Appending a string to a null value..? Appending a string to an undefined value, via array addition, which turns them into strings but doesn't turn null into
by mhio 5y ago
> Appending a string to a null value..?
Appending a string to an undefined value, via array addition, which turns them into strings but doesn't turn null into 'null' or undefined into 'undefined'. It's a bit of a hack.
`'a' + undefined === 'aundefined'`
`[ 'a' ] + [ undefined ] === 'a'`
Also the empty string '' evaluates to false.
`[ undefined ] + [ undefined ] == ''`
This is wat - https://archive.org/details/wat_destroyallsoftware https://archive.org/details/wat_destroyallsoftware