diff options
author | Ryan Johnson <rjohnson@mozilla.com> | 2021-04-29 16:16:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 16:16:42 -0700 |
commit | 95aca4b4d8fa62815d4bd412fff1a364f842814a (patch) | |
tree | 5e57661720fe9058d5c7db637e764800b50f9060 /files/ca/web/javascript/reference/global_objects/boolean/index.html | |
parent | ee3b1c87e3c8e72ca130943eed260ad642246581 (diff) | |
download | translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.gz translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.bz2 translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.zip |
remove retired locales (#699)
Diffstat (limited to 'files/ca/web/javascript/reference/global_objects/boolean/index.html')
-rw-r--r-- | files/ca/web/javascript/reference/global_objects/boolean/index.html | 197 |
1 files changed, 0 insertions, 197 deletions
diff --git a/files/ca/web/javascript/reference/global_objects/boolean/index.html b/files/ca/web/javascript/reference/global_objects/boolean/index.html deleted file mode 100644 index d0a6d6eef7..0000000000 --- a/files/ca/web/javascript/reference/global_objects/boolean/index.html +++ /dev/null @@ -1,197 +0,0 @@ ---- -title: Boolean -slug: Web/JavaScript/Reference/Global_Objects/Boolean -translation_of: Web/JavaScript/Reference/Global_Objects/Boolean -original_slug: Web/JavaScript/Referencia/Objectes_globals/Boolean ---- -<div>{{JSRef("Global_Objects", "Boolean")}}</div> - -<h2 id="Summary" name="Summary">Resum</h2> - -<p>L'objecte <strong><code>Boolean</code></strong> és un objecte que embolcalla valors booleans.</p> - -<h2 id="Syntax" name="Syntax">Constructor</h2> - -<pre class="syntaxbox"><code>new Boolean([<var>valors</var>])</code></pre> - -<h3 id="Parameters" name="Parameters">Paràmetres</h3> - -<dl> - <dt><code>valors</code></dt> - <dd>Opcional. El valor inicial de l'objecte <code>Boolean</code>.</dd> -</dl> - -<h2 id="Description" name="Description">Descripció</h2> - -<p>El valor passat com a primer paràmetre es converteix a un valor booleà, en cas necesari. Si és omés o si és <code>0</code>, <code>-0</code>, {{jsxref("Global_Objects/null", "null")}}, <code>false</code>, {{jsxref("Global_Objects/NaN", "NaN")}}, {{jsxref("Global_Objects/undefined", "undefined")}}, o la cadena de caràcters buida (<code>""</code>), l'objecte tindrà el valor inicial <code>false</code>. Tots els altres valors, incloent qualsevol objecte o la cadena de caràcters <code>"false"</code>, crea un objecte amb el valor inicial de <code>true</code>.</p> - -<p>No confoneu els valors <code>Boolean</code> primitius <code>true</code> i <code>false</code> amb els valors <code>true</code> i <code>false</code> de l'objecte <code>Boolean</code>.</p> - -<p>Qualsevol objecte el valor del qual no sigui {{jsxref("Global_Objects/undefined", "undefined")}} o {{jsxref("Global_Objects/null", "null")}}, incloent un objecte de tipus <code>Boolean</code> el valor del qual sigui <code>false</code>, evalua a <code>true</code> quan es passa a una sentència condicional. Per exemple, la condició en la següent sentència {{jsxref("Statements/if...else", "if")}} evalua a <code>true</code>:</p> - -<pre class="brush: js">x = new Boolean(false); -if (x) { - // aquest codi s'executarà -} -</pre> - -<p>Aquest comportament no s'aplica a les primitives de tipus booleà. Per exemple, la condició en la següent sentència {{jsxref("Statements/if...else", "if")}} evalua a <code>false</code>:</p> - -<pre class="brush: js">x = false; -if (x) { - // aquest codi no s'executarà -} -</pre> - -<p>No creeu una instància de <code>Boolean</code> per a convertir un valor no booleà a un valor booleà. En comptes d'això utilitzeu <code>Boolean</code> com una funció per a realitzar aquesta tasca:</p> - -<pre class="brush: js">x = Boolean(expression); // utilitzar preferentment -x = new Boolean(expression); // no ho utilitzeu -</pre> - -<p>Si s'especifica qualsevol objecte, inclòs un objecte <code>Boolean</code> el valor del qual sigui false, com a valor inicial per a un objecte <code>Boolean</code>, el nou objecte <code>Boolean</code> tindrà un valor de <code>true</code>.</p> - -<pre class="brush: js">myFalse = new Boolean(false); // valor inicial false -g = new Boolean(myFalse); // valor inicial true -myString = new String('Hello'); // objecte de tipus String -s = new Boolean(myString); // valor inicial true -</pre> - -<p>No utilitzeu un objecte <code>Boolean</code> quan podríeu utilitzar un valor primitiu booleà.</p> - -<h2 id="Properties" name="Properties">Propietats</h2> - -<dl> - <dt><code>Boolean.length</code></dt> - <dd>La propietat Length retorna el valor de 1.</dd> - <dt>{{jsxref("Boolean.prototype")}}</dt> - <dd>Representa el prototip pel constructor <code>Boolean</code>.</dd> -</dl> - -<p>{{jsOverrides("Function", "Properties", "prototype")}}</p> - -<h2 id="Methods" name="Methods">Mètodes</h2> - -<p>L'objecte <code>Boolean</code> no té mètodes propis. Hereta, però, alguns mètodes a través de la cadena de prototipus:</p> - -<div>{{jsOverrides("Function", "Methods")}}</div> - -<h2 id="Boolean_instances" name="Boolean_instances"><code>Instàncies de Boolean</code></h2> - -<p>Totes les instàncies de <code>Boolean</code> hereten de {{jsxref("Boolean.prototype")}}. Com tots els constructors, el prototipus de l'objecte dicta les propietats i mètodes que heretaran les instàncies.</p> - -<h3 id="Propietats">Propietats</h3> - -<div>{{page('/ca/docs/Web/JavaScript/Reference/Global_Objects/Boolean/prototype', 'Properties')}}</div> - -<h3 id="Mètodes">Mètodes</h3> - -<div>{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/prototype', 'Methods')}}</div> - -<h2 id="Examples" name="Examples">Exemples</h2> - -<h3 id="Example:_Creating_Boolean_objects_with_an_initial_value_of_false" name="Example:_Creating_Boolean_objects_with_an_initial_value_of_false">Exemple: Crear objectes <code>Boolean</code> amb un valor inicial de<code> false</code></h3> - -<pre class="brush: js">var bNoParam = new Boolean(); -var bZero = new Boolean(0); -var bNull = new Boolean(null); -var bEmptyString = new Boolean(''); -var bfalse = new Boolean(false); -</pre> - -<h3 id="Example:_Creating_Boolean_objects_with_an_initial_value_of_true" name="Example:_Creating_Boolean_objects_with_an_initial_value_of_true">Exemple: Crear objectes <code>Boolean amb un valor inicial de</code> <code>true</code></h3> - -<pre class="brush: js">var btrue = new Boolean(true); -var btrueString = new Boolean('true'); -var bfalseString = new Boolean('false'); -var bSuLin = new Boolean('Su Lin'); -var bArrayProto = new Boolean([]); -var bObjProto = new Boolean({}); -</pre> - -<h2 id="Especificacions">Especificacions</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Especificació</th> - <th scope="col">Estat</th> - <th scope="col">Comentaris</th> - </tr> - <tr> - <td>ECMAScript 1a Edició.</td> - <td>Standard</td> - <td>Definició inicial. Implementat a JavaScript 1.0.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.6', 'Boolean')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-boolean-objects', 'Boolean')}}</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>{{CompatIE("6.0")}}</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="See_also" name="See_also">Vegeu també</h2> - -<ul> - <li>{{jsxref("Boolean.prototype")}}</li> - <li>{{Glossary("Boolean")}}</li> - <li><a href="http://en.wikipedia.org/wiki/Boolean_data_type">El tipus de dades booleà (Wikipedia)</a></li> -</ul> |