What sort of issues with ES5 are static class methods in ES6 supposed to deal with?
The Babel documentation has the following example in its section regarding ES6 classes, though it does not actually state what this pattern accomplishes.
Classes support prototype-based inheritance, super calls, instance and static methods and constructors
class SkinnedMesh extends THREE.Mesh {
constructor(geometry, materials) {
super(geometry, materials);
this.idMatrix = SkinnedMesh.defaultMatrix();
this.bones = [];
this.boneMatrices = [];
//...
}
update(camera) {
//...
super.update();
}
static defaultMatrix() {
return new THREE.Matrix4();
}
}
statickeyword to indicate to the developer that this method doesn't use information from the current instance - similar to using underscore-prefixed names to indicate private properties - even though that may not necessarily be the case, it's a nice bit of self-commenting if used correctly