JS高阶知识点
js面向对象创建对象1.字面量//字面量创建对象var p1 = { name: '张三', age: 18}2.构造函数//构造函数创建对象1. function Person() { this.name = '张三'; this.age = 18; } 2. function Person(name,age) { this.name = name; this.age = age; }var p1 = new Person
原创
2020-12-24 17:35:31 ·
213 阅读 ·
3 评论