typeOf - simple yet robust


/ Published in: JavaScript
Save to your folder(s)

Brilliant solution using Object.prototype.toString()

Test cases included (commented out)

URL: http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.