Hi everyone, quick syntax question.
I'm manually defining some data (hardcoding) in a manner like this:
Code:
myArray = [[a,b,c], [], [1,2,3]];
A 2d array, note the empty array in the middle.
What i want to know, is how to check if one of these arrays is empty, before trying to load data from it. For example, do i use:
Code:
if (myArray[1] != null)
Code:
if (myArray[1] != undefined)
Code:
if (myArray[1].length != 0)
Code:
if (myArray[1] != [])
or something else i haven't thought of? What syntax do i need to successfully exclude that middle array and NOT read it ?