javascript count number of object properties