Prototype-number-succ

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

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

このメソッドは、現在の+で定義されている現在のNumberの後継を返します。 1。 ObjectRangeと互換性のある番号を作成するために使用されます。

構文

number.succ();

戻り値

現在の番号の後継者を丸めます。

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

      <script>
         function showResult() {
            alert( "(5).succ() : " + (5).succ() );
            alert( "(-5).succ()  : " + (-5).succ() );
         }
      </script>
   </head>

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

出力