Answers for "for i in arr js"

0

for array javascript

let iterable = [10, 20, 30];

for (let value of iterable) {
  value += 1;
  console.log(value);
}
// 11
// 21
// 31
Posted by: Guest on October-25-2020
0

for item loop

const object = {a: 1, b: 2, c: 3};

for (const property in object) {
  console.log(`${property}: ${object[property]}`);
}

// expected output:
// "a: 1"
// "b: 2"
// "c: 3"
Posted by: Guest on February-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language