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/array/findindex/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/array/findindex') diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html index 7b1e3c7143..b0c8967e8e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/findindex/index.html @@ -20,7 +20,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/findIndex

语法

-
arr.findIndex(callback[, thisArg])
+
arr.findIndex(callback[, thisArg])

参数

@@ -62,7 +62,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/findIndex

以下示例查找数组中素数的元素的索引(如果不存在素数,则返回-1)。

-
function isPrime(element, index, array) {
+
function isPrime(element, index, array) {
   var start = 2;
   while (start <= Math.sqrt(element)) {
     if (element % start++ < 1) {
@@ -77,7 +77,7 @@ console.log([4, 6, 7, 12].findIndex(isPrime)); // 2

Polyfill

-
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
+
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
 if (!Array.prototype.findIndex) {
   Object.defineProperty(Array.prototype, 'findIndex', {
     value: function(predicate) {
-- 
cgit v1.2.3-54-g00ecf