diff options
Diffstat (limited to 'files/ca/web/javascript/reference/global_objects/string/fromcharcode')
| -rw-r--r-- | files/ca/web/javascript/reference/global_objects/string/fromcharcode/index.html | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/files/ca/web/javascript/reference/global_objects/string/fromcharcode/index.html b/files/ca/web/javascript/reference/global_objects/string/fromcharcode/index.html deleted file mode 100644 index e168171699..0000000000 --- a/files/ca/web/javascript/reference/global_objects/string/fromcharcode/index.html +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: String.fromCharCode() -slug: Web/JavaScript/Reference/Global_Objects/String/fromCharCode -translation_of: Web/JavaScript/Reference/Global_Objects/String/fromCharCode -original_slug: Web/JavaScript/Referencia/Objectes_globals/String/fromCharCode ---- -<div>{{JSRef}}</div> - -<p>El mètode estàtic <strong><code>String.fromCharCode()</code></strong> retorna un string creat a partir de la seqüència de valors Unicode especificada.</p> - -<h2 id="Sintaxi">Sintaxi</h2> - -<pre class="syntaxbox"><code>String.fromCharCode(<var>num1</var>[, ...[, <var>numN</var>]])</code></pre> - -<h3 id="Paràmetres">Paràmetres</h3> - -<dl> - <dt><code>num1, ..., num<em>N</em></code></dt> - <dd>Una seqüència de nombres que són valors Unicode.</dd> -</dl> - -<h2 id="Descripció">Descripció</h2> - -<p>Aquest mètode retorna un string i no un objecte de tipus {{jsxref("String")}}.</p> - -<p>Com que <code>fromCharCode()</code> és un mètode estàtic de {{jsxref("String")}}, sempre s'utilitza com <code>String.fromCharCode()</code> en comptes de com un mètode d'un objecte {{jsxref("String")}} creat.</p> - -<h2 id="Exemples">Exemples</h2> - -<h3 id="Utilitzar_fromCharCode()">Utilitzar <code>fromCharCode()</code></h3> - -<p>L'exemple següent retorna el string "ABC".</p> - -<pre class="brush: js">String.fromCharCode(65, 66, 67); // "ABC" -</pre> - -<h2 id="Fer_que_funcioni_amb_valors_més_grans">Fer que funcioni amb valors més grans</h2> - -<p>Tot i que la majoria dels valors Unicode es poden representar amb un nombre de 16 bits (tal i com s'esperava mentre s'estava estandaritzant el JavaScript) i es pot emprar <code>fromCharCode()</code> per a retornar un sol caràcter per als valors més comuns (com ara valors UCS-2, que són un subconjunt de l'UTF-16 amb els caràcters més comuns), per a poder manegar TOTS els valors legals Unicode (els quals requereixen fins a 21 bits), l'ús de només <code>fromCharCode()</code> no és adequat ja que els caràcters de valor més alt utilitzen dos nombres "substituts" (de menor valor) per a formar un sol caràcter. Es pot emprar {{jsxref("String.fromCodePoint()")}} (que forma part de l'esborrant de l'ECMAScript 6) per a retornar el parell de nombres citat i, d'aquesta forma, representar de manera adequada aquests caràcters de valor més alt.</p> - -<h2 id="Especificacions">Especificacions</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Especificacions</th> - <th scope="col">Estat</th> - <th scope="col">Comentaris</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Definició inicial. Implementat a JavaScript 1.2.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.5.3.2', 'StringfromCharCode')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-string.fromcharcodes', 'String.fromCharCode')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilitat_amb_navegadors">Compatibilitat amb navegadors</h2> - -<div>{{CompatibilityTable}}</div> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Suport bàsic</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Android</th> - <th>Chrome for Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Suport bàsic</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Vegeu_també">Vegeu també</h2> - -<ul> - <li>{{jsxref("String.fromCodePoint()")}}</li> - <li>{{jsxref("String.prototype.charAt()")}}</li> - <li>{{jsxref("String.prototype.charCodeAt()")}}</li> - <li>{{jsxref("String.prototype.codePointAt()")}}</li> -</ul> |
