トップに戻る
tags
function objectLength( obj ) { let objectLength = 0; for (let key in obj) { objectLength++; } return objectLength; }
console.log( objectLength({}) ); // 0 console.log( objectLength({a:'hoge',b: 'fuga'}) ); // 2
edit