Testing different methods of checking whether an element is or is in another element. Start from the position where you have jquery objects. Make === or parentNodes a function call. Check that alternatives return the correct answer. Try with a container selector rather than element (the main advantage() of closest())
Comparing performance of: !!closest.length vs == and parentNodes vs !!closest.length selector vs == and parentNodes selector
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
Test case name
Result
!!closest.length
== and parentNodes
!!closest.length selector
== and parentNodes selector
Fastest:N/A
Slowest:N/A
ⓘGet performance results from real users on your website with Request Metrics.
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one to run it!