I saw you using this format in one of your recent ...
# best-practices
a
I saw you using this format in one of your recent videos, and I didn't even know you could style
contains
this way. I refactored all of our codebase using this method and it makes everything cleaner/shorter/easier to read. I was curious about how it compares to
get > contains
in terms of performance. I assume that if you use
get > contains
, you first query the DOM for the element selector, then filter the returned object for a string. If you use
contains with selector modifier
does the same logical process happen, or is the full DOM queried for the string, and then THAT object is filtered for the element query match? Depending on how your DOM is structured and how commonly words appear in text, I could imagine this having some (probably minor) performance implications - but do you know how those two different approaches vary "under the hood"?
2 Views