Array.lengthonly counts values whose key is numeric. You use strings as keys, so your length is always 0. Although this is legal (since arrays are objects), it is confusing and unsuitable for an array.
As @Sudhir suggests, use "object" or "hash": the notation {}. Much clearer. (Although I disagree with it by modifying Object.prototype)