diff options
author | Alexey Pyltsyn <lex61rus@gmail.com> | 2021-10-27 02:31:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 02:31:24 +0300 |
commit | 980fe00a74a9ad013b945755415ace2e5429c3c2 (patch) | |
tree | a1c6bb4b302e69bfa53eab13e44500eba55d1696 /files/ru/web/javascript/reference/global_objects/object/entries/index.html | |
parent | 374a039b97a11ee7306539d16aaab27fed66b398 (diff) | |
download | translated-content-980fe00a74a9ad013b945755415ace2e5429c3c2.tar.gz translated-content-980fe00a74a9ad013b945755415ace2e5429c3c2.tar.bz2 translated-content-980fe00a74a9ad013b945755415ace2e5429c3c2.zip |
[RU] Remove notranslate (#2874)
Diffstat (limited to 'files/ru/web/javascript/reference/global_objects/object/entries/index.html')
-rw-r--r-- | files/ru/web/javascript/reference/global_objects/object/entries/index.html | 10 |
1 files changed, 5 insertions, 5 deletions
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 <h2 id="Синтаксис">Синтаксис</h2> -<pre class="syntaxbox notranslate"><code>Object.entries(<var>obj</var>)</code></pre> +<pre class="syntaxbox"><code>Object.entries(<var>obj</var>)</code></pre> <h3 id="Параметры">Параметры</h3> @@ -30,7 +30,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/entries <h2 id="Примеры">Примеры</h2> -<pre class="brush: js notranslate">var obj = { foo: "bar", baz: 42 }; +<pre class="brush: js">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'] ]</pre> -<pre class="notranslate"><code>// returns an empty array for any primitive type, since primitives have no own properties +<pre><code>// 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]) => { <p>Конструктор {{jsxref("Map", "new Map()")}} принимает повторение <em>значений</em>. С <code>Object.entries </code>вы легко можете преобразовать {{jsxref("Object")}} в {{jsxref("Map")}}:</p> -<pre class="brush: js notranslate">var obj = { foo: "bar", baz: 42 }; +<pre class="brush: js">var obj = { foo: "bar", baz: 42 }; var map = new Map(Object.entries(obj)); console.log(map); // Map { foo: "bar", baz: 42 }</pre> @@ -75,7 +75,7 @@ console.log(map); // Map { foo: "bar", baz: 42 }</pre> <p>Используя <a href="https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#%D0%A0%D0%B0%D0%B7%D0%B1%D0%BE%D1%80_%D0%BC%D0%B0%D1%81%D1%81%D0%B8%D0%B2%D0%BE%D0%B2">метод Разбора Массивов</a> Вы можете легко итерировать объекты.</p> -<pre class="notranslate"><code>const obj = { foo: 'bar', baz: 42 }; +<pre><code>const obj = { foo: 'bar', baz: 42 }; Object.entries(obj).forEach(([key, value]) => console.log(`${key}: ${value}`)); // "foo: bar", "baz: 42"</code></pre> <h2 id="Полифил">Полифил</h2> |