javascript get count of object properties