From 01b0e12ba27b5069248fd09235e9a7143915ee30 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:02:49 +0800 Subject: remove `notranslate` class in zh-CN --- .../reference/global_objects/string/startswith/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/string/startswith') diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/startswith/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/startswith/index.html index 7cbd48ba7b..ac60af390f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/startswith/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/startswith/index.html @@ -21,7 +21,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/startsWith

语法

-
str.startsWith(searchString[, position])
+
str.startsWith(searchString[, position])

参数

@@ -44,7 +44,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/startsWith

此方法已被添加至 ECMAScript 2015 规范之中,但可能不能在所有的现行 JavaScript 实现中使用。不过,你可以用以下的代码段为 String.prototype.startsWith() 制作 Polyfill:

-
if (!String.prototype.startsWith) {
+
if (!String.prototype.startsWith) {
     Object.defineProperty(String.prototype, 'startsWith', {
         value: function(search, pos) {
             pos = !pos || pos < 0 ? 0 : +pos;
@@ -60,7 +60,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/startsWith
 
 

使用 startsWith()

-
var str = "To be, or not to be, that is the question.";
+
var str = "To be, or not to be, that is the question.";
 
 alert(str.startsWith("To be"));         // true
 alert(str.startsWith("not to be"));     // false
-- 
cgit v1.2.3-54-g00ecf