: 함수에 전달된 인수에 해당하는 배열 형태의 객체 (배열 X) (유사배열일 뿐..)
function func1(a, b, c) { console.log(arguments[0]) // 'first' console.log(arguments[1]) // 'second' console.log(arguments[2]) // 'third' } func1('first', 'second', 'third');
function func1(a, b, c) { return argument } const arg = func1('first', 'second', 'third'); // arg는 argument 객체 console.log(Array.isArray(arg)) // false
- arg는 argument 객체. 유사 배열. (배열 X)
function func() { return arguments; } const arg = func('first', 'second', 'third') console.log(arg[0]) // 'first' console.log(arg[1]) // 'second' console.log(arg[2]) // 'third'