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/object/entries/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'files/ru/web/javascript/reference/global_objects/object/entries/index.html') diff --git a/files/ru/web/javascript/reference/global_objects/object/entries/index.html b/files/ru/web/javascript/reference/global_objects/object/entries/index.html index fd74a6a286..5cba32dbc5 100644 --- a/files/ru/web/javascript/reference/global_objects/object/entries/index.html +++ b/files/ru/web/javascript/reference/global_objects/object/entries/index.html @@ -11,7 +11,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/entries

Синтаксис

-
Object.entries(obj)
+
Object.entries(obj)

Параметры

@@ -30,7 +30,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/entries

Примеры

-
var obj = { foo: "bar", baz: 42 };
+
var obj = { foo: "bar", baz: 42 };
 console.log(Object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ]
 
 // массив как объект
@@ -49,7 +49,7 @@ console.log(Object.entries(my_obj)); // [ ['foo', 'bar'] ]
 // non-object argument will be coerced to an object
 console.log(Object.entries("foo")); // [ ['0', 'f'], ['1', 'o'], ['2', 'o'] ]
-
// returns an empty array for any primitive type, since primitives have no own properties
+
// returns an empty array for any primitive type, since primitives have no own properties
 console.log(Object.entries(100)); // [ ]
 
 // iterate through key-value gracefully
@@ -67,7 +67,7 @@ Object.entries(obj).forEach(([key, value]) => {
 
 

Конструктор {{jsxref("Map", "new Map()")}} принимает повторение значений. С Object.entries вы легко можете преобразовать {{jsxref("Object")}} в {{jsxref("Map")}}:

-
var obj = { foo: "bar", baz: 42 };
+
var obj = { foo: "bar", baz: 42 };
 var map = new Map(Object.entries(obj));
 console.log(map); // Map { foo: "bar", baz: 42 }
@@ -75,7 +75,7 @@ console.log(map); // Map { foo: "bar", baz: 42 }

Используя метод Разбора Массивов Вы можете легко итерировать объекты.

-
const obj = { foo: 'bar', baz: 42 };
+
const obj = { foo: 'bar', baz: 42 };
 Object.entries(obj).forEach(([key, value]) => console.log(`${key}: ${value}`)); // "foo: bar", "baz: 42"

Полифил

-- cgit v1.2.3-54-g00ecf