This is an experimental technology, part of the ECMAScript 6 (Harmony) proposal.
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future version of browsers as the spec changes.
Summary
A static method definition is used to define a static method for a class. Static method do not appear on instances of the class.
Syntax
static methodName() { ... }
Description
Static methods are only relevant to the class itself rather than to instances of the class.
Examples
// TBD
Specifications
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 6 (ECMA-262) The definition of 'Class definitions' in that specification. |
Release Candidate | Initial definition. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 42.0 | Available in the Nightly channel only (since February 2015) | ? | ? | ? |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | ? | 42.0 | Available in the Nightly channel only (since February 2015) | ? | ? | ? |