Calling a property of an array within an array?

Calling a property of an array within an array?
0.0 0

#1


function inAscOrder(arr)
{

  for(i=0;i<arr.length;i++)
  {
    
    for(var j=0 ; j< arr.i.length ; j++)
    {

      if(arr.i[j+1]<arr.i[j])
      {
        return false
        
      }



    }

    if(arr[i+1]<arr[i])
    {
      return false

    }
    console.log(arr[i])

    
    






  }




 return true



}
var array1 = [[1,2,4,7,19], 5];



inAscOrder(array1)

how do I get the length of a list within an array

so like
var array = [[1,2,3,4,3],2]
I want to do soemthing like
arr.1.length

Its giving me the following error

image


#2

The array variable has a first element, with index 0, that is an array and a second element, with index 1, that is a number. To get the length of the array inside the array do this: array[0].length

JavaScript properties that begin with a digit cannot be referenced with dot notation; and must be accessed using bracket notation.

from:

Also, here you need to declare the variable i:

like you declare the j variable in the other loop.