From 980fe00a74a9ad013b945755415ace2e5429c3c2 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 27 Oct 2021 02:31:24 +0300 Subject: [RU] Remove notranslate (#2874) --- .../reference/global_objects/string/replaceall/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'files/ru/web/javascript/reference/global_objects/string/replaceall') diff --git a/files/ru/web/javascript/reference/global_objects/string/replaceall/index.html b/files/ru/web/javascript/reference/global_objects/string/replaceall/index.html index 318e9a30c3..3c4ce6551f 100644 --- a/files/ru/web/javascript/reference/global_objects/string/replaceall/index.html +++ b/files/ru/web/javascript/reference/global_objects/string/replaceall/index.html @@ -15,7 +15,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replaceAll

Syntax

-
const newStr = str.replaceAll(regexp|substr, newSubstr|function)
+
const newStr = str.replaceAll(regexp|substr, newSubstr|function)
 
@@ -119,20 +119,20 @@ translation_of: Web/JavaScript/Reference/Global_Objects/String/replaceAll

Using replaceAll

-
'aabbcc'.replaceAll('b', '.');
+
'aabbcc'.replaceAll('b', '.');
 // 'aa..cc'

Non-global regex throws

Поиск с регулярными выражениями должен быть с ("g"). Это не работает:

-
'aabbcc'.replaceAll(/b/, '.');
+
'aabbcc'.replaceAll(/b/, '.');
 TypeError: replaceAll must be called with a global RegExp
 

Это работает:

-
'aabbcc'.replaceAll(/b/g, '.');
+
'aabbcc'.replaceAll(/b/g, '.');
 "aa..cc"
 
-- cgit v1.2.3-54-g00ecf