
前端
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 · 153 阅读 · 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 · 127 阅读 · 0 评论