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) --- .../javascript/reference/classes/static/index.html | 117 --------------------- 1 file changed, 117 deletions(-) delete mode 100644 files/ca/web/javascript/reference/classes/static/index.html (limited to 'files/ca/web/javascript/reference/classes/static/index.html') diff --git a/files/ca/web/javascript/reference/classes/static/index.html b/files/ca/web/javascript/reference/classes/static/index.html deleted file mode 100644 index c8c015d731..0000000000 --- a/files/ca/web/javascript/reference/classes/static/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: static -slug: Web/JavaScript/Reference/Classes/static -translation_of: Web/JavaScript/Reference/Classes/static -original_slug: Web/JavaScript/Referencia/Classes/static ---- -
{{jsSidebar("Classes")}}
- -

La paraula clau static defineix un mètode estàtic per a una classe.

- -

Sintaxi

- -
static methodName() { ... }
- -

Descripció

- -

Els mètodes estàtics es criden sense realitzar una instantània de la seva classe o instantiating their class nor are they callable when the class is instantiated. Els mètodes estàtics s'utilitzen sovint per crear funcions d'utilitat per una aplicació.

- -

Exemples

- -

L'exemple següent mostra diverses coses. Mostra com un mètode estàtic és implementat en una classe i que una classe amb un membre estàtic pot tenir subclasses. Finalment, mostra com es pot i com no es pot cridar un mètode estàtic.

- -
class Tripple {
-  static tripple(n) {
-    n = n | 1;
-    return n * 3;
-  }
-}
-
-class BiggerTripple extends Tripple {
-  static tripple(n) {
-    return super.tripple(n) * super.tripple(n);
-  }
-}
-
-console.log(Tripple.tripple());
-console.log(Tripple.tripple(6));
-console.log(BiggerTripple.tripple(3));
-var tp = new Tripple();
-console.log(tp.tripple()); //Logs 'tp.tripple is not a function'.
- -

Especificacions

- - - - - - - - - - - - - - -
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-class-definitions', 'Class definitions')}}{{Spec2('ES6')}}Definició inicial.
- -

Compatibilitat amb navegadors

- -

{{CompatibilityTable}}

- -
- - - - - - - - - - - - - - - - - - - -
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatChrome(42.0)}}Disponible només en el canal Nightly  (desde febrer del 2015){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
CaracterísticaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatUnknown}}{{CompatChrome(42.0)}}Disponible només en el canal Nightly  (desde febrer del 2015){{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

Vegeu també

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