[JS_오답노트]_for(let variable of Array)

hanseungjune·2022년 5월 31일
0

JavaScript

목록 보기
48/87
post-thumbnail

일단 필기!

//for(let Array[index] of Array){}
let influencer = ['suwonlog','small.tiger','Minam.ludens','cu_convenience24']

for( let i = 0 ; i < influencer.length ; i++ ) {
  console.log(influencer[i]);     //suwonlog, small.tiger, Minam.ludens, cu_convenience24
}

for(let variable of influencer) {
  console.log(variable);          //suwonlog, small.tiger, Minam.ludens, cu_convenience24
}

요약

for( let Array[index] of influencer ) 은
influencer 이라는 배열의 value를 하나씩 variable에 넣어서 반복하여 출력해줌을 뜻함.

그래서 이렇게 나올 수 있다.

profile
필요하다면 공부하는 개발자, 한승준

0개의 댓글