Last active
July 10, 2020 15:16
-
-
Save sandrabosk/2d411ae38dcd34e9cc102dc6df0cb29e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 fruits = ['apple', 'plum', 'strawberries']; | |
// 1 | |
for(let i=0; i < fruits.length; i++){ | |
console.log(fruits[i]); | |
} | |
// apple | |
// plum | |
// strawberries | |
// 2 | |
fruits.forEach((oneFruit, index) => console.log(index, oneFruit)); | |
// 0 'apple' | |
// 1 'plum' | |
// 2 'strawberries' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment