Member variables in ES6 classes

前端 未结 3 1278
日久生厌
日久生厌 2020-12-15 16:34

Is there any way to use the ECMAScript6 class notation to declare either a static class variable or a default value for an instance variable? Without clas

3条回答
  •  忘掉有多难
    2020-12-15 17:14

    While it's not part of the ES6 spec, this looks like it's coming soon and is already supported by Babel and some others.

    Here's the spec: https://github.com/jeffmo/es-class-fields-and-static-properties

    And a full list of all the proposals and their status: https://github.com/tc39/ecma262

提交回复
热议问题