js for each item in array
const avengers = ['thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
console.log(index, item)
})let words = ['one', 'two', 'three', 'four'];
words.forEach((word) => {
console.log(word);
});
// one
// two
// three
// fourconst array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));
// expected output: "a"
// expected output: "b"
// expected output: "c"
Also in JavaScript:
- graphql custom JSON scalar type
- javascript replace big list
- bootstrap show modal on page load
- angular router navigate base href
- javascript array push method
- discord bot remove message reaction
- how to find dates in a string in js
- remove square brackets from string javascript
- add and remove class in jquery
- how to make an alphabet in javascript
- Javascript append item to array
- js call and apply
- clear scene\
- get syntethicbaseevent and parameter in react
- remove extra space in string javascript
- jquery autoSuggestList
- tf js change weighs
- javascript string to integer
- js concat arrays with redeuce
- Calculate string value in javascript, not using eval
- how to code a minecraft json file mod
- include node_modules from search vscode
- remove object from array by name javascript
- callback in js