Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

for..of

let colors = ['Red', 'Green', 'Blue'];

for (const [index, color] of colors.entries()) {
    console.log(`${color} is at index ${index}`);
}Code language: JavaScript (javascript)
Comment

for...of...loop

const array = ['a', 'b', 'c', 'd'];
for (const item of array) {
	console.log(item)
}
// Result: a, b, c, d

const string = 'Ire Aderinokun';
for (const character of string) {
	console.log(character)
}
// Result: I, r, e, , A, d, e, r, i, n, o, k, u, n
Comment

for ... of ...

// for ... of ...
for (let char of "Hello") {
  console.log(char);
}

// console result:
H
e
l
l
o
Comment

JavaScript for...of loop

for (element of iterable) {
    // body of for...of
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Error: ENOENT: no such file or directory, lstat ode_modules@react-navigationcoresrcgetStateFromPath.tsx 
Javascript :: infinite scroll for chat react js 
Javascript :: alpine js open outside div 
Javascript :: countdown js 
Javascript :: Javascript using forEach loop to loop through an array 
Javascript :: The removeChild() Method 
Javascript :: how to check if object exists in array javascript 
Javascript :: jquery syntax 
Javascript :: prettier printWidth 
Javascript :: vue style background color 
Javascript :: my angular modal popup is not closing automatically 
Javascript :: pass props in compound component 
Javascript :: substr method 
Javascript :: how to compare previous value with current in jquery 
Javascript :: iterate over array javascript 
Javascript :: ternaire javascript 
Javascript :: how to add the click event into two element in jquery 
Javascript :: merge intervals 
Javascript :: get index of first number in string javascript 
Javascript :: discord bot remove message reaction 
Javascript :: iterating string js 
Javascript :: How to clear one property of state in vuex store 
Javascript :: how to map through an object javascript 
Javascript :: route guard in react js 
Javascript :: how to create a javascript hello world program with node.js 
Javascript :: express mysql sessions 
Javascript :: find match in array object js 
Javascript :: react native build 
Javascript :: sequelize association alias 
Javascript :: check file name in url 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =