Function.arguments
지원이 중단되었습니다: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
function.arguments
속성은 함수로 부터 넘겨 받은 arguments에 해당하는 배열과 같은 객체이다. 간단하게arguments
를 대신 사용하자. 이 속성은 strict mode에서 꼬리 호출 최적화 때문에 금지 된다.
설명
예제
arguments object를 사용한 예시
function f(n) { g(n - 1); }
function g(n) {
console.log('before: ' + g.arguments[0]);
if (n > 0) { f(n); }
console.log('after: ' + g.arguments[0]);
}
f(2);
console.log('returned: ' + g.arguments);
// Output
// before: 1
// before: 0
// after: 0
// after: 1
// returned: null
Specifications
function.arguments
는 표준이 아니다. ECMAScript 3에서 arguments
를 참조하기 때문에 deprecated 되었다.
Browser 호환성
BCD tables only load in the browser