Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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



> This is wat

For a second, I thought it was JavaScript


That's what I said :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: