jquery方法
var data = {};
var b = $.isEmptyObject(data);
alert(b);//true
將json對象轉化為json字符串,再判斷該字符串是否為"{}"
var data = {};
var b = (JSON.stringify(data) === "{}");
alert(b);//true
刪除json對象中的key
for(var key in student){
delete student[key];
}
console.log(student);