Skip to content

Instantly share code, notes, and snippets.

@scriptschat
Created Sep 22, 2020
Embed
What would you like to do?
Using for of loop with an array
const fruits = ['apple', 'orange', 'kiwi', 'grapes', 'pineapple'];
for(fruit of fruits) {
console.log(fruit);
}
// Output
// apple
// orange
// kiwi
// grapes
// pineapple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment