diff options
author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:07:31 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
commit | d9e9adb5f80a819fe46349bcf6d1faec734b09cd (patch) | |
tree | e856dc5e31aad0a7d5e8c2f98c9ee139d9569a86 /files/zh-cn/web/javascript/reference/global_objects/isnan | |
parent | 7c2556fe79c44d7c31108b8c8b048d2b7704a95e (diff) | |
download | translated-content-d9e9adb5f80a819fe46349bcf6d1faec734b09cd.tar.gz translated-content-d9e9adb5f80a819fe46349bcf6d1faec734b09cd.tar.bz2 translated-content-d9e9adb5f80a819fe46349bcf6d1faec734b09cd.zip |
remove span tag in zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/isnan')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/isnan/index.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/isnan/index.html b/files/zh-cn/web/javascript/reference/global_objects/isnan/index.html index e9fd9ff613..772c25bc8e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/isnan/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/isnan/index.html @@ -48,10 +48,10 @@ translation_of: Web/JavaScript/Reference/Global_Objects/isNaN <p>一个<code>isNaN</code>的 polyfill 可以理解为(这个polyfill利用了<code>NaN</code>自身永不相等于自身这一特征 ):</p> -<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">var</span> isNaN <span class="operator token">=</span> <span class="keyword token">function</span><span class="punctuation token">(</span>value<span class="punctuation token">)</span> <span class="punctuation token">{</span> - <span class="keyword token">var</span> n <span class="operator token">=</span> <span class="function token">Number</span><span class="punctuation token">(</span>value<span class="punctuation token">)</span><span class="punctuation token">;</span> - <span class="keyword token">return</span> n <span class="operator token">!==</span> n<span class="punctuation token">;</span> -<span class="punctuation token">}</span><span class="punctuation token">;</span></code></pre> +<pre class="brush: js line-numbers language-js"><code class="language-js">var isNaN = function(value) { + var n = Number(value); + return n !== n; +};</code></pre> <h2 id="Examples" name="Examples">示例</h2> |