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.
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.
yes, totally true. Thanks for sharing, Akash.