Function.arguments
Deprecated
Avoid using this feature in new projects.
JavaScript strict mode prohibits accessing the caller and arguments properties of a Function object.
This feature may be a candidate for removal from web standards or browsers. >
function.argumentsìì±ì í¨ìë¡ ë¶í° ë겨 ë°ì argumentsì í´ë¹íë ë°°ì´ê³¼ ê°ì ê°ì²´ì´ë¤. ê°ë¨íê²arguments를 ëì ì¬ì©íì. ì´ ìì±ì strict modeìì 꼬리 í¸ì¶ ìµì í ë문ì ê¸ì§ ëë¤.
ì¤ëª
function.arguments 문ë²ì deprecated ëìë¤. í¨ì ë´ ìì ì¬ì© ê°ë¥í ê°ì²´argumentsì ì ê·¼íë ì¶ì²ëë ë°©ë²ì ë¨ìí argumentsë³ìë¡ ì°¸ì¡°íë ê²ì´ë¤.
ë°ë³µë¬¸ì ê²½ì°, í¨ì f ê° ì¬ë¬ë² í¸ì¶ ì¤íì ëíëë©´, f.argumentsì ê°ì í¨ìì ê°ì¥ ìµê·¼ í¸ì¶ arguments를 ëíë¸ë¤.
argumentsì ê°ì í¨ì ì¤í ê³¼ì ìì í¹ë³í í¸ì¶ì´ ìë¤ë©´ ì¼ë°ì ì¼ë¡ null ì´ë¤ (ì¦, í¨ìê° í¸ì¶ì ëìì¼ë ë°íëì§ ìì).
ìì
>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
ëª ì¸ì
function.argumentsë íì¤ì´ ìëë¤. ECMAScript 3ìì arguments를 참조í기 ë문ì deprecated ëìë¤.