Outer loop goes through the outer array. For each inner array, the inner loop goes through it. Then you have another loop which tries to loop through each individual value. They’re numbers, you can’t loop through a number, it’s just a number, so the function breaks when you try to that.
So in the first pass of your looping, i==0 and j==0. arr[0] is that first sub-array, and arr[0][0] [because remember, both i and j are 0] is 1 - the first element of that sub-array. And 1, being of type Number, doesn’t have a length.