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 --- .../javascript/reference/global_objects/string/endswith/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/string/endswith/index.html') diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/endswith/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/endswith/index.html index fb6728a8a0..dd5597701e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/endswith/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/endswith/index.html @@ -23,7 +23,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/endsWith

语法

-
str.endsWith(searchString[, length])
+
str.endsWith(searchString[, length])

参数

@@ -46,7 +46,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/endsWith

这个方法已经加入到 ECMAScript 6 标准当中,但是可能还没有在所有的  JavaScript 实现中可用。然而,你可以通过如下的代码片段扩展 String.prototype.endsWith() 实现兼容:

-
if (!String.prototype.endsWith) {
+
if (!String.prototype.endsWith) {
 	String.prototype.endsWith = function(search, this_len) {
 		if (this_len === undefined || this_len > this.length) {
 			this_len = this.length;
@@ -60,7 +60,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/endsWith
 
 

使用 endsWith()

-
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.endsWith("question.") );  // true
 alert( str.endsWith("to be") );      // false
-- 
cgit v1.2.3-54-g00ecf