DEV Community

Discussion on: Understanding and Implementing Linked Lists in JavaScript with ES6

Collapse
 
akashkava profile image
Akash Kava

Entire DOM is a big nested linked list (graph), navigating with nextElementSibling is faster compared to navigating children array.

Linked list is the best option for event handlers as adding/removing is easy. As function itself Is an object, you can simply add prev and next members to form a linked list without allocating new object for each node.

Collapse
 
blarzhernandez profile image
Roberto Hernandez

yes, totally true. Thanks for sharing, Akash.