Javascript getElementById lookups - hash map or recursive tree traversal?

前端 未结 4 1746
一向
一向 2020-12-08 04:30

Does the DOM have a hash-table of elements whose keys are the elements\' ids?
I want to know if document.getElementById looks up a hash table or traverses t

4条回答
  •  情深已故
    2020-12-08 05:09

    It shouldn't be hard to test.

    If it's tree-based then making a very deep tree (via Javascript) should be a good test case.

提交回复
热议问题