aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/javascript/reference/errors/not_a_codepoint
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
commit074785cea106179cb3305637055ab0a009ca74f2 (patch)
treee6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/ru/web/javascript/reference/errors/not_a_codepoint
parentda78a9e329e272dedb2400b79a3bdeebff387d47 (diff)
downloadtranslated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz
translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2
translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip
initial commit
Diffstat (limited to 'files/ru/web/javascript/reference/errors/not_a_codepoint')
-rw-r--r--files/ru/web/javascript/reference/errors/not_a_codepoint/index.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/files/ru/web/javascript/reference/errors/not_a_codepoint/index.html b/files/ru/web/javascript/reference/errors/not_a_codepoint/index.html
new file mode 100644
index 0000000000..0b72d6c50f
--- /dev/null
+++ b/files/ru/web/javascript/reference/errors/not_a_codepoint/index.html
@@ -0,0 +1,50 @@
+---
+title: 'RangeError: argument is not a valid code point'
+slug: Web/JavaScript/Reference/Errors/Not_a_codepoint
+translation_of: Web/JavaScript/Reference/Errors/Not_a_codepoint
+---
+<div>{{jsSidebar("Errors")}}</div>
+
+<h2 id="Сообщение">Сообщение</h2>
+
+<pre class="syntaxbox">RangeError: Invalid code point {0} (Edge)
+RangeError: {0} is not a valid code point (Firefox)
+RangeError: Invalid code point {0} (Chrome)
+</pre>
+
+<h2 id="Тип_ошибки">Тип ошибки</h2>
+
+<p>{{jsxref("RangeError")}}</p>
+
+<h2 id="Что_пошло_не_так">Что пошло не так?</h2>
+
+<p>Метод {{jsxref("String.fromCodePoint()")}} выдает ошибку, если ему было передано значение {{jsxref("NaN")}}, отрицательное целое число (-1), нецелое число (5.4) или значение, которое превышает 0x10FFFF (1114111).</p>
+
+<p><a href="https://en.wikipedia.org/wiki/Code_point">Кодовая точка (code point)</a> – это значение в кодовом пространстве Unicode, то есть диапазон целых чисел от <code>0</code> до <code>0x10FFFF</code>.</p>
+
+<h2 id="Примеры">Примеры</h2>
+
+<h3 id="Нерабочие_случаи">Нерабочие случаи</h3>
+
+<pre class="brush: js example-bad">String.fromCodePoint('_'); // RangeError
+String.fromCodePoint(Infinity); // RangeError
+String.fromCodePoint(-1); // RangeError
+String.fromCodePoint(3.14); // RangeError
+String.fromCodePoint(3e-2); // RangeError
+String.fromCodePoint(NaN); // RangeError</pre>
+
+<h3 id="Рабочие_случаи">Рабочие случаи</h3>
+
+<pre class="brush: js example-good">String.fromCodePoint(42); // "*"
+String.fromCodePoint(65, 90); // "AZ"
+String.fromCodePoint(0x404); // "\u0404"
+String.fromCodePoint(0x2F804); // "\uD87E\uDC04"
+String.fromCodePoint(194564); // "\uD87E\uDC04"
+String.fromCodePoint(0x1D306, 0x61, 0x1D307) // "\uD834\uDF06a\uD834\uDF07"
+</pre>
+
+<h2 id="Смотрите_также">Смотрите также</h2>
+
+<ul>
+ <li>{{jsxref("String.fromCodePoint()")}}</li>
+</ul>