直接上代码function Person (a, b) { this.a = a; this.b = b;
this.get = (name) => { return this[name]
}
}let obj = { a: 1, b: 2, c: 3,
}let obj2 = new Person(11, 22)let url = new URL('https://jsfiddle.net')console.log({...obj})console.log('==================')console.log(obj2)console.log({...obj2})console.log('==================')console.log(url)console.log({...url})运行结果是:疑问:为什么console.log({...url})的结果是空对象???
添加回答
举报
0/150
提交
取消