for loop:
}
substring("eclipse", 1, 4); //clip
substring("eclipse", 1, 4); //clip
For arrays and strings, we use index [] to access specific values; for objects, we also use [], but we will use a special variable: propertyName
for (var propertyName in person) {
console.log(propertyName ":" person[propertyName]);
}
var i;
var rows=table.length;
for (r=0;r
var cells = table[r].length ;
var rowText = "";
for (c=0;c
if (c < cells-1 ) {
🎜>Person Age City
Sue 22 San Francisco
Joe 45 Halifax
Use break to exit the loop immediately, suitable for for and while loops.