在es6的class中可以使用static声明静态方法,但是静态方法只能在未实例化,一般在什么情况下会用到静态方法? 或者说 不得不用到静态方法?我想到一个场景就是 类似于其他语言中的 私有函数,拿来在实例化方法中验证之类的。
2 回答
桃花长相依
TA贡献1860条经验 获得超8个赞
Promise 的 resolve race 算不算?
Promise.resolve(1)
.then(anotherPromise)
.then(andAnother)
.then()
Promise.race(aPromise, bPromise)
.then(handleTwo)
同时 Promise 也可以 new
添加回答
举报
0/150
提交
取消
