DEV Community

Discussion on: Do you know these weird parts of JavaScript?

Collapse
 
lqj profile image
QJ Li • Edited

I thought about +!+[], it could be like these (I may be wrong)

1. `+[]` is `0` 
2. `!0` is `true` 
3. `+true` is `1`
Collapse
 
dhanushkadev profile image
Dhanushka madushan

I think thats the solution. It's working on console.