typeof()=='object' being used too much in js

RESOLVED DUPLICATE of bug 1318907

Status

()

RESOLVED DUPLICATE of bug 1318907
2 years ago
2 years ago

People

(Reporter: jmichae3, Unassigned)

Tracking

50 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161123182536

Steps to reproduce:

typeof(Array())
typeof(document.getElementById('tableid').getElementsByTagName("tr").childNodes)


Actual results:

'object'
'object'


Expected results:

Array should really return a typeof() of 'array', not 'object', just like HTMLCollection should return 'htmlcollection' not 'object'. 'object is being used as a catch-all type when clearly-defined types exist.
htmlcollection should be tossed in favor of the array methods anyway (how do you delete a row or column? certainly not with slice)

Updated

2 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1318907
You need to log in before you can comment on or make changes to this bug.