diff options
author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:02:49 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
commit | 01b0e12ba27b5069248fd09235e9a7143915ee30 (patch) | |
tree | 0e9edf538dc3fa3331e1dbb79239b58186765f86 /files/zh-cn/web/javascript/reference/global_objects/string/includes | |
parent | 6ca84f1794af830ada9736d7289ce29aabb04ca3 (diff) | |
download | translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.gz translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.bz2 translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.zip |
remove `notranslate` class in zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/string/includes')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html index 83ced4b38a..672a34166f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/includes/index.html @@ -16,7 +16,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/includes <h2 id="Syntax" name="Syntax">语法</h2> -<pre class="syntaxbox notranslate"><var>str</var>.includes(<var>searchString</var>[, <var>position</var>])</pre> +<pre class="syntaxbox"><var>str</var>.includes(<var>searchString</var>[, <var>position</var>])</pre> <h3 id="参数">参数</h3> @@ -39,13 +39,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/includes <p><code>includes()</code> 方法是区分大小写的。例如,下面的表达式会返回 <strong><code>false</code></strong> :</p> -<pre class="notranslate"><code>'Blue Whale'.includes('blue'); // returns false</code></pre> +<pre><code>'Blue Whale'.includes('blue'); // returns false</code></pre> <h2 id="兼容补丁">兼容补丁</h2> <p>这个方法已经被加入到 ECMAScript 6 标准中,但未必在所有的 JavaScript 实现中都可以使用。然而,你可以轻松地 polyfill 这个方法:</p> -<pre class="notranslate"><code>if (!String.prototype.includes) { +<pre><code>if (!String.prototype.includes) { String.prototype.includes = function(search, start) { 'use strict'; if (typeof start !== 'number') { @@ -64,7 +64,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/includes <h3 id="使用_includes">使用 includes()</h3> -<pre class="notranslate"><code>var str = 'To be, or not to be, that is the question.'; +<pre><code>var str = 'To be, or not to be, that is the question.'; console.log(str.includes('To be')); // true console.log(str.includes('question')); // true |