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