JavaScript/constructor:修订间差异
来自康健生活
| 第23行: | 第23行: | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
! | ! colspan=6| pc !! colspan=6| mobile !! server | ||
|- | |- | ||
! {{Vertical header|stp=1|chrome}} | ! {{Vertical header|stp=1|chrome}} | ||
2020年6月25日 (四) 01:50的版本
引言
constructor 是一种用于创建和初始化class创建的对象的特殊方法。[1]
constructor([arguments]) { ... }
判断
constructor 属性返回对创建此对象的数组函数的引用。
兼容版本
| pc | mobile | server | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 49 | 13 | 45 | NO | 36 | 9 | 49 | 49 | 45 | 36 | 9 | 5.0 | 6.0.0 |
- ↑ constructor-JavaScript|MDN[EB/OL].https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Classes/constructor
No categories