When I create an array like this in browser console:
var myList = ['home', '',, 'school',,,];
And when I print the value in console by typing myList it gives the result like this:
(6) ["home", "", empty, "school", empty × 2]
As you can see the array index 2 is labeled as empty but when I explicitly type myList[2] it shows it as undefined:
undefined
& if I change its value to undefined and then print it out it changes empty value to undefined:
myList[2] = undefined;
myList
(6) ["home", "", undefined, "school", empty × 2]
I tried to google on this but most of the place claim empty is just a string empty but that is not the case here... the trailing comma in Array isn't assigned any empty string and even in the if condition it only gives a true value if checked against undefined and a false against an empty string ... where the keyword empty itself is not a keyword of JavaScript.