Goal: Get the target element inside the DOM
Test case #1 - You don't have the target id - Find a target element through DOM via Element.closest()
Test case #2 - You have the target id from your state - Find the target element via Document.querySelector()
Comparing performance of: closest vs for loop vs closest (miss) vs for loop (miss)
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory