mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Add one more example
This commit is contained in:
parent
145e76d3b3
commit
1b67ecb30c
@ -228,6 +228,11 @@ numbers = moreNumbers; // Error, mutating methods are missing
|
||||
|
||||
// for..of statement
|
||||
// iterate over the list of values on the object being iterated
|
||||
let arrayOfAnyType = [1, "string", false];
|
||||
for (let val of arrayOfAnyType) {
|
||||
console.log(val); // 1, "string", false
|
||||
}
|
||||
|
||||
let list = [4, 5, 6];
|
||||
for (let i of list) {
|
||||
console.log(i); // "4", "5", "6"
|
||||
|
Loading…
Reference in New Issue
Block a user