構文
 
  関数オブジェクト名.arity
総合 インデックス
プロパティ
FirefoxIE

説明

  • Functionオブジェクトの要素数の値を持つプロパティ。
  • 「arity」プロパティは,Internet Explorer,Opera,Safariでは,サポートされていない。

用例

functionオブジェクト「MyFunction」の要素数を取得し書き出す。
<script type="text/javascript">
<!--
MyFunction = new Function("x", "y", "return x + y");
document.write("64+36 = " + MyFunction(64,36));
document.write("<br>");
document.write("arity:" + MyFunction.arity);
//-->
</script>

この用例を実行する