Array detection in Javascript var arr = [1, 2]; Object.prototype.toString.call(arr) === "[object Array]"