Prototype-enum-member

提供:Dev Guides
移動先:案内検索

プロトタイプ-Enumerable member()メソッド

このメソッドは、==比較演算子に基づいて、指定されたオブジェクトがEnumerableにあるかどうかを判断します。 これはinclude()の便利なエイリアスです。

構文

Iterator.member(object);

戻り値

指定されたオブジェクトが見つかった場合はtrue、それ以外の場合はfalseを返します。

<html>
   <head>
      <title>Prototype examples</title>
      <script type = "text/javascript" src = "/javascript/prototype.js"></script>

      <script>
         function showResult() {
            alert("$R(1,15).member(10) : " +  $R(1,15).member(10) );
           //Returns true.
         }
      </script>
   </head>

   <body>
      <p>Click the button to see the result.</p>
      <br/>
      <br/>
      <input type = "button" value = "Result" onclick = "showResult();"/>
   </body>
</html>

出力