diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 21:46:22 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 21:46:22 -0500 |
commit | a065e04d529da1d847b5062a12c46d916408bf32 (patch) | |
tree | fe0f8bcec1ff39a3c499a2708222dcf15224ff70 /files/ca/web/javascript/referencia | |
parent | 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (diff) | |
download | translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.gz translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.bz2 translated-content-a065e04d529da1d847b5062a12c46d916408bf32.zip |
update based on https://github.com/mdn/yari/issues/2028
Diffstat (limited to 'files/ca/web/javascript/referencia')
3 files changed, 0 insertions, 330 deletions
diff --git a/files/ca/web/javascript/referencia/objectes_globals/array/observe/index.html b/files/ca/web/javascript/referencia/objectes_globals/array/observe/index.html deleted file mode 100644 index 0214800297..0000000000 --- a/files/ca/web/javascript/referencia/objectes_globals/array/observe/index.html +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: Array.observe() -slug: Web/JavaScript/Referencia/Objectes_globals/Array/observe -translation_of: Archive/Web/JavaScript/Array.observe ---- -<div>{{JSRef}}</div> - -<p>El mètode <strong><code>Array.observe()</code></strong>s'utilitza per observar canvis en Arrays de forma asíncrona, de forma similar a que {{jsxref("Object.observe()")}} ho fa en objectes. Proporciona una corrent de canvis en l'ordre d'aparició. Es equivalent a la crida de <code>Object.observe()</code> <u>amb la llista de tipus acceptar </u><code>["add", "update", "delete", "splice"]</code>.</p> - -<h2 id="Sintaxi">Sintaxi</h2> - -<pre class="syntaxbox"><code>Array.observe(<var>arr</var>, <var>callback</var>)</code></pre> - -<h3 id="Paràmetres">Paràmetres</h3> - -<dl> - <dt><code>arr</code></dt> - <dd>L'array que s'ha d'observar.</dd> - <dt><code>callback</code></dt> - <dd>La funció es crida cada cop que es realitzen canvis, amb el següent argument: - <dl> - <dt><code>changes</code></dt> - <dd>Un array d'objectes cadascun dels quals representa un canvi. Les propietats d'aquests objectes de canvis són: - <ul> - <li><strong><code>name</code></strong>: El nom de la propietat que s'ha canviat.</li> - <li><strong><code>object</code></strong>: L'array canviat després que s'hagués produït el canvi.</li> - <li><strong><code>type</code></strong>: Una cadena que indica el tipus de canvi que s'ha portat a cap. Un de <code>"add"</code>, <code>"update"</code>, <code>"delete"</code>, o <code>"splice"</code>.</li> - <li><strong><code>oldValue</code></strong>: Únicament pel tipus <code>"update"</code> i <code>"delete"</code>. El valor abans del canvi.</li> - <li><strong><code>index</code></strong>: Únicament pel tipus <code>"splice"</code>. L'índex en el qual s'ha produït el canvi.</li> - <li><strong><code>removed</code></strong>: Únicament pel tipus <code>"splice</code>. Un array dels elements eliminats.</li> - <li><strong><code>addedCount</code></strong>: Únicament pel tipus<code>"splice"</code>. EL nombre d'elements afegits.</li> - </ul> - </dd> - </dl> - </dd> -</dl> - -<h2 id="Descripció">Descripció</h2> - -<p>La funció <code>callback</code> es crida cada cop que es realitza un canvi en <code>arr</code>, amb un array de tots els canvis tal i com han succeït.</p> - -<div class="note"> -<p>Els canvis fets a través de mètodes d'Array, com ara <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop"><code>Array.prototype.pop()</code></a>seràn contats com a canvis de <code>"splice"</code>. Canvis d'assignació d'índexs que no canvien la llargària de l'array poden contar-se com a canvis <code>"update"</code>.</p> -</div> - -<h2 id="Exemples">Exemples</h2> - -<h3 id="Iniciar_diferents_tipus_de_canvis">Iniciar diferents tipus de canvis</h3> - -<pre class="brush: js">var arr = ['a', 'b', 'c']; - -Array.observe(arr, function(changes) { - console.log(changes); -}); - -arr[1] = 'B'; -// [{type: 'update', object: <arr>, name: '1', oldValue: 'b'}] - -arr[3] = 'd'; -// [{type: 'splice', object: <arr>, index: 3, removed: [], addedCount: 1}] - -arr.splice(1, 2, 'beta', 'gamma', 'delta'); -// [{type: 'splice', object: <arr>, index: 1, removed: ['B', 'c', 'd'], addedCount: 3}] -</pre> - -<h2 id="Especificacions">Especificacions</h2> - -<p><a href="https://github.com/arv/ecmascript-object-observe">Strawman proposal for ECMAScript 7</a>.</p> - -<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>{{CompatChrome("36")}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Android</th> - <th>Chrome per 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>{{CompatNo}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Vegeu_també">Vegeu també</h2> - -<ul> - <li><a href="//stackoverflow.com/q/29269057/778272">Under what condition would Array.observe's “add” event trigger?</a></li> - <li>{{jsxref("Array.unobserve()")}} {{experimental_inline}}</li> - <li>{{jsxref("Object.observe()")}} {{experimental_inline}}</li> -</ul> diff --git a/files/ca/web/javascript/referencia/objectes_globals/number/tointeger/index.html b/files/ca/web/javascript/referencia/objectes_globals/number/tointeger/index.html deleted file mode 100644 index b8fcd39443..0000000000 --- a/files/ca/web/javascript/referencia/objectes_globals/number/tointeger/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Number.toInteger() -slug: Web/JavaScript/Referencia/Objectes_globals/Number/toInteger -translation_of: Archive/Web/JavaScript/Number.toInteger ---- -<div>{{JSRef}} {{obsolete_header("33")}} {{non-standard_header}}</div> - -<p>El mètode <strong><code>Number.toInteger()</code></strong> evaluava el valor passat com a paràmetre i el convertia en un nombre sencer, aquest mètode, però, ha sigut eliminat.</p> - -<p>Si el valor és {{jsxref("NaN")}}, {{jsxref("null")}} o bé {{jsxref("undefined")}}, es retorna 0. Si el valor és <code>false</code>, es retorna 0 mentre que si el valor és <code>true</code>, es retorna 1.</p> - -<h2 id="Sintaxi">Sintaxi</h2> - -<pre class="syntaxbox"><code>Number.toInteger(<em>nombre</em>)</code></pre> - -<h3 id="Paràmetres">Paràmetres</h3> - -<dl> - <dt><code>nombre</code></dt> - <dd>El valor a convertir-se en un nombre sencer.</dd> -</dl> - -<h2 id="Exemples">Exemples</h2> - -<h3 id="Utilitzar_toInteger">Utilitzar <code>toInteger</code></h3> - -<pre class="brush: js">Number.toInteger(0.1); // 0 -Number.toInteger(1); // 1 -Number.toInteger(Math.PI); // 3 -Number.toInteger(null); // 0 -</pre> - -<h2 id="Especificacions">Especificacions</h2> - -<p><code>Number.toInteger()</code> era part de l'esborrany de l'especificació de l'ECMAScript 6, però el 23 d'agost de 2013 es va eliminar a la revisió 17 de l'esborrany.</p> - -<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>{{CompatNo}}</td> - <td>{{CompatNo}} [1]</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</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>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}} [1]</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<p>[1] Aquesta característica va estar suportada des del Firefox 16 al 32.</p> - -<h2 id="Vegeu_també">Vegeu també</h2> - -<ul> - <li>{{jsxref("Number")}}</li> -</ul> diff --git a/files/ca/web/javascript/referencia/objectes_globals/string/quote/index.html b/files/ca/web/javascript/referencia/objectes_globals/string/quote/index.html deleted file mode 100644 index f8027d070a..0000000000 --- a/files/ca/web/javascript/referencia/objectes_globals/string/quote/index.html +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: String.prototype.quote() -slug: Web/JavaScript/Referencia/Objectes_globals/String/quote -translation_of: Archive/Web/JavaScript/String.quote ---- -<div>{{JSRef}} {{obsolete_header("37")}} {{non-standard_header}}</div> - -<p>El mètode no estàndard <strong><code>quote()</code></strong> retorna una còpia de la cadena, reemplaçant diferents caràcters especials de la cadena amb les seves seqüències d'escapament i embolcalla el resultat amb cometes dobles (<code>"</code>).</p> - -<h2 id="Sintaxi">Sintaxi</h2> - -<pre class="syntaxbox"><code><var>str</var>.quote()</code></pre> - -<h2 id="Exemples">Exemples</h2> - -<p>A la taula següent, el mètode <code>quote()</code> reemplaça els caràcters especials i embolcalla les cadenes amb cometes dobles. Tingueu en compte que en la tercera on un {{jsxref("Global_Objects/eval", "eval()")}} embolcallat avalua la seqüència d'escapament novament.</p> - -<table class="fullwidth-table"> - <thead> - <tr> - <th class="header" scope="col"><code>str</code></th> - <th class="header" scope="col"><code>str.quote()</code></th> - <th class="header" scope="col"><code>eval(str.quote())</code></th> - </tr> - </thead> - <tbody> - <tr> - <td><code>Hello world!</code></td> - <td><code>"Hello world!"</code></td> - <td><code>Hello world!</code></td> - </tr> - <tr> - <td><code style="white-space: pre;">Hello<br> - world!</code></td> - <td><code>"Hello\n\tworld!"</code></td> - <td><code style="white-space: pre;">Hello<br> - world!</code></td> - </tr> - <tr> - <td><code>" \ — '</code></td> - <td><code>"\" \\ \u2014 '"</code></td> - <td><code>" \ — '</code></td> - </tr> - </tbody> -</table> - -<h2 id="Especificacions">Especificacions</h2> - -<p>No forma part de cap estàndard. Implementant en JavaScript 1.3.</p> - -<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>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Android</th> - <th>Chrome per 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>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Vegeu_també">Vegeu també</h2> - -<ul> - <li>{{jsxref("JSON.stringify()")}}</li> -</ul> |