mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-17 00:04:34 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -41,12 +41,12 @@
|
||||
<p>为了成功返回一个有限值,你可能会使用 <code>Number.NEGATIVE_INFINITY</code> 属性来判断是否显示一个条件错误 。然而 <a href="Reference/Global_Objects/isFinite" title="该全局 isFinite() 函数用来判断被传入的参数值是否为一个有限数值(finite number)。在必要情况下,参数会首先转为一个数值。"><code>isFinite</code></a> 方法更适合这种情况。</p>
|
||||
<h2 id="Example" name="Example">示例</h2>
|
||||
<p>下例中,赋值给变量 <code>smallNumber</code> 一个明显小于 JavaScript 中的最小值的值。当 <code>if</code> 语句执行时,<code>smallNumber</code> 值为 "<code>-Infinity</code>",因此在继续执行代码前,<code>smallNumber</code> 被设为一个更容易管理的值。</p>
|
||||
<pre class="brush:js">var smallNumber = (-Number.MAX_VALUE) * 2
|
||||
<pre><code class="language-js">var smallNumber = (-Number.MAX_VALUE) * 2
|
||||
|
||||
if (smallNumber == Number.NEGATIVE_INFINITY) {
|
||||
smallNumber = returnFinite();
|
||||
}
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user