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