js if array is 2d

JavaScript
if (arr[0].constructor === Array) { /*...*/ }
Source

Also in JavaScript: