讀書筆記.關於es5對象的實例化和繼承的簡單理解

1.es5的類實現是通過function構造函數實現的如 通過new的方式實例化這個構造函數。可以添加一下方法如 function Student(name) { this.name=name; this.read=function() { alert(this.name+‘我在讀書’) } } let s=new Student(‘zs’); 我們可以給類綁定靜態的方法如 Student.eat
相關文章
相關標籤/搜索