Just JavaScript
JavaScript supports conditionals, loops and statements like other high-level languages. JavaScript supports familiar constructs including:
- if, if/else conditionals
- switch statements
- conditional (ternary) operator
- for, while and do..while loops
- try…catch, finally
- arrays
- functions/methods
- iterating an array using for … of
// iterating through an array
for (let yr of years) {
console.log(yr);
}
// functionally equivalent
for (let i = 0; i < years.length; i++) {
let yr = years[i];
console.log(yr);
}