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

x && !Array.isArray(x) && typeof x === 'object'.

its typical to start off with `var &&` to avoid operations on null & undefined values



For environment lacks Array.isArray method i think this works well

!!(x && x.__proto__ === [].__proto__)




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

Search: