This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['Poland', 'Germany', 'France', 'Russia', 'Japan'].sort(); | |
// ["France", "Germany", "Japan", "Poland", "Russia"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var objectArray = {a: 1, b: 2, c: 3}; | |
for (const item in objectArray) { | |
console.log(item) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const array = [1,2,3,4,5,6]; | |
array.forEach(function(item, index, array) { | |
console.log(`index ${index}, value ${item}, array ${array}`); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let index = 0; | |
const array = [1,2,3,4,5,6]; | |
while (index < array.length) { | |
console.log(array[index]); | |
index++; | |
} |
NewerOlder