자바스크립트 배열 forEach()

1 개요[ | ]

Array.prototype.forEach()
자바스크립트 배열 forEach()
const nums = [10, 20, 30];
nums.forEach(x => {
  console.log(x);
});
const nums = [10, 20, 30];
nums.forEach((x, i) => {
  console.log("x=", x, "i=", i);
});
const nums = [10, 20, 30];
nums.forEach((value, index, array) => {
  console.log("value=", value, "index=", index, "array=", array);
});

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}