From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- .../global_objects/array/includes/index.html | 159 --------------------- 1 file changed, 159 deletions(-) delete mode 100644 files/ca/web/javascript/reference/global_objects/array/includes/index.html (limited to 'files/ca/web/javascript/reference/global_objects/array/includes') diff --git a/files/ca/web/javascript/reference/global_objects/array/includes/index.html b/files/ca/web/javascript/reference/global_objects/array/includes/index.html deleted file mode 100644 index b788348abb..0000000000 --- a/files/ca/web/javascript/reference/global_objects/array/includes/index.html +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: Array.prototype.includes() -slug: Web/JavaScript/Reference/Global_Objects/Array/includes -translation_of: Web/JavaScript/Reference/Global_Objects/Array/includes -original_slug: Web/JavaScript/Referencia/Objectes_globals/Array/includes ---- -
{{JSRef}}
- -

El mètode includes() determina si un array inclou un element concret, retornant  true o false segons s'escaigui. 

- -

Sintaxi

- -
var boolean = array.includes(elementCercat[, desdePosicio])
- -

Parameters

- -
-
elementCercat
-
L'element a cercar.
-
desdePosicio
-
Opcional. La posició de l'array a partir de la qual començar la cerca de elementCercat. Un valor negatiu cercarà el nombre absolut donat de posicions contant des del final de l'array. El seu valor per defecte és 0.
-
- -

Valor retornat

- -

Un {{jsxref("Boolean")}}.

- -

Exemples

- -
[1, 2, 3].includes(2);     // true
-[1, 2, 3].includes(4);     // false
-[1, 2, 3].includes(3, 3);  // false
-[1, 2, 3].includes(3, -1); // true
-[1, 2, NaN].includes(NaN); // true
-
- -

Polyfill

- -
if (!Array.prototype.includes) {
-  Array.prototype.includes = function(searchElement /*, fromIndex*/ ) {
-    'use strict';
-    var O = Object(this);
-    var len = parseInt(O.length) || 0;
-    if (len === 0) {
-      return false;
-    }
-    var n = parseInt(arguments[1]) || 0;
-    var k;
-    if (n >= 0) {
-      k = n;
-    } else {
-      k = len + n;
-      if (k < 0) {k = 0;}
-    }
-    var currentElement;
-    while (k < len) {
-      currentElement = O[k];
-      if (searchElement === currentElement ||
-         (searchElement !== searchElement && currentElement !== currentElement)) { // NaN !== NaN
-        return true;
-      }
-      k++;
-    }
-    return false;
-  };
-}
-
- -

Especificacions

- - - - - - - - - - - - - - - - - - - -
EspecificacióEstatComentaris
{{SpecName('ES7', '#sec-array.prototype.includes', 'Array.prototype.includes')}}{{Spec2('ES7')}}Definició inicial.
{{SpecName('ESDraft', '#sec-array.prototype.includes', 'Array.prototype.includes')}}{{Spec2('ESDraft')}} 
- -

Compatibilitat amb navegadors

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
CaracterísticaChromeFirefox (Gecko)Internet ExplorerEdgeOperaSafari
Suport bàsic -

{{CompatChrome(47)}}

-
43{{CompatNo}}{{CompatNo}}349
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
CaracterísticaAndroidAndroid WebviewFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Android
Suport bàsic{{CompatNo}} -

{{CompatChrome(47)}}

-
43{{CompatNo}}349 -

{{CompatChrome(47)}}

-
-
- -

Vegeu també

- - -- cgit v1.2.3-54-g00ecf