aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/javascript/reference/errors/not_a_codepoint
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:41:45 -0500
commit1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch)
tree0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/javascript/reference/errors/not_a_codepoint
parent4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff)
downloadtranslated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2
translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip
initial commit
Diffstat (limited to 'files/es/web/javascript/reference/errors/not_a_codepoint')
-rw-r--r--files/es/web/javascript/reference/errors/not_a_codepoint/index.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/files/es/web/javascript/reference/errors/not_a_codepoint/index.html b/files/es/web/javascript/reference/errors/not_a_codepoint/index.html
new file mode 100644
index 0000000000..0c89773f6b
--- /dev/null
+++ b/files/es/web/javascript/reference/errors/not_a_codepoint/index.html
@@ -0,0 +1,51 @@
+---
+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="Message">Message</h2>
+
+<pre class="syntaxbox">RangeError: {0} is not a valid code point (Firefox)
+RangeError: Invalid code point {0} (Chrome)
+</pre>
+
+<h2 id="Tipo_de_error">Tipo de error</h2>
+
+<p>{{jsxref("RangeError")}}</p>
+
+<h2 id="¿Qué_estuvo_mal">¿Qué estuvo mal?</h2>
+
+<p>El metodo {{jsxref("String.fromCodePoint()")}} acepta solamente <em><strong>code point</strong></em> validos.</p>
+
+<p>Un <a href="https://en.wikipedia.org/wiki/Code_point">code point</a> es un valor en el conjunto de caracteres <a href="/es/docs/">Unicode</a>; esto es, un rango de enteros que va desde <code>0</code> a <code>0x10FFFF</code>.</p>
+
+<p>Usando valores {{jsxref("NaN")}}, enteros negativos (<code>-1</code>), no enteros (<code>3.14</code>), o valores mayores a <code>0x10FFFF</code> (<code>1114111</code>) no trabajarian con este metodo.</p>
+
+<h2 id="Ejemplos">Ejemplos</h2>
+
+<h3 id="Casos_invalidos">Casos invalidos</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="Casos_validos">Casos validos</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="Observe_tambien">Observe tambien</h2>
+
+<ul>
+ <li>{{jsxref("String.fromCodePoint()")}}</li>
+</ul>