
前端
Jujuxiaer
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
手写深拷贝(JS)
手写深拷贝(JS) 代码 const oldObj = { name: "Jujuxiaer", age: 20, colors: ['orange', 'red', 'blue'], friends: { name: "小可" } } const newObj1 = oldObj; newObj1.name = "小华"; console.log(oldObj); console.log(newObj1); function deepClone原创 2021-04-27 14:11:02 · 164 阅读 · 0 评论 -
原型(JS)
原型(JS) 代码: class Student { constructor(name, score) { this.name = name; this.score = score; } introduce() { console.log(`我是${this.name}, 考了${this.score}分。`); } } const student = new Student("Jujuxiaer, 92"); console.log('student', s原创 2021-04-27 14:08:45 · 144 阅读 · 0 评论