爲什麼以下函數返回undefined
?javascript中的全局靜態函數
var global_vars =
{
countNumOfProperties :
function (obj)
{
var count = 0;
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
++count;
}
return count;
}
}
};
var DS =
{
file_types_lookup : {}
};
global_vars.countNumOfProperties(DS.file_types_lookup)