Function.arguments
非推奨;: この機能は非推奨になりました。まだ対応しているブラウザーがあるかもしれませんが、すでに関連するウェブ標準から削除されているか、削除の手続き中であるか、互換性のためだけに残されている可能性があります。使用を避け、できれば既存のコードは更新してください。このページの下部にある互換性一覧表を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。
function.arguments
プロパティは、関数に渡される引数に対応する、配列風のオブジェクトです。より単純な arguments
変数を使用してください。このプロパティは厳格モードでは使用できません。
解説
例
arguments オブジェクトの使用
js
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
仕様書
何れかの標準で定義されたものではありません。 ECMAScript 3 で arguments
に置き換えられました。
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arguments |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Non-standard. Check cross-browser support before using.
- Deprecated. Not for use in new websites.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.