Count Object Properties Efficiently in JavaScript | CodeTrail