check to see if array is nested js code example Example: js if array is 2d if (arr[0].constructor === Array) { /*...*/ }