問題:
What is the fastest way to check if an object is empty or not?檢查對象是否爲空的最快方法是什麼?
Is there a faster and better way than this:有沒有比這更快更好的方法:
function count_obj(obj){
var i = 0;
for(var key in obj){
++i;
}
return i;
}
解決方案:
參考一: https://stackoom.com/question/KxDd參考二: Is object empty? [duplicate]