可以使用for...in循环遍历对象的所有属性,并将它们赋值为undefined或null来清空对象的属性。 for (var key in obj) { obj[key] = undefined; }