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

> [] + {}

"[object Object]"

> {} + []

0

JS and PHP are the prototypical examples of weak typing.



Again, not sure about PHP. But no, JS is strongly typed. What you've shown there is coercion, not type-punning or anything of the sort.




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

Search: