Tag Archives: JavaScript

JavaScript Style Guide

The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what is said rather than on how it’s said. If code added to a file looks drastically different from the existing code around it, it throws readers out of their rhythm when they go to read it. […]

Robust way to check if a variable is an array in Javascript

If you use plain javascript, this’ll be helpful If you use jQuery 1.3+, you can try this – $.isArray( obj ). More on this here: http://api.jquery.com/jQuery.isArray/ Still, you’re not convinced and want an explanation? You can visit this page to read an explanation (probably the detailed one I’ve seen so far!) by Kangax http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/