arguments 객체

frenchkebab·2021년 10월 7일
0

javascript 지식

목록 보기
35/36
post-thumbnail

arguments

arguments 객체는 함수에 전달된 인수에 해당하는 유사 배열 객체 이다. (즉, forEach, map 등의 배열 메서드들을 사용할 수 없다/)

function func1(a, b, c) {
  console.log(arguments[0]);
  // expected output: 1

  console.log(arguments[1]);
  // expected output: 2

  console.log(arguments[2]);
  // expected output: 3
}

func1(1, 2, 3);
profile
Blockchain Dev Journey

0개의 댓글