Forum Discussion
Nandhu19940
May 11, 2020Copper Contributor
Array concept and looping doubt
In attached excel you can find two columns of data where Column A- Industry Column B- Engine no In column F you can find the status of engine, here i need to get the status of engine output...
Lewis-H
May 11, 2020Iron Contributor
var a = []; // Create a new empty array.
a[5] = 5; // Perfectly legal JavaScript that resizes the array.
for (var i = 0; i < a.length; i++) {
// Iterate over numeric indexes from 0 to 5, as everyone expects.
console.log(a[i]);
}
/* Will display:
undefined
undefined
undefined
undefined
undefined
5
*/
a[5] = 5; // Perfectly legal JavaScript that resizes the array.
for (var i = 0; i < a.length; i++) {
// Iterate over numeric indexes from 0 to 5, as everyone expects.
console.log(a[i]);
}
/* Will display:
undefined
undefined
undefined
undefined
undefined
5
*/