javascript - Why are jQuery objects inherently unique? -
reading jquery objects here, states jquery objects unique, if "this true if object created same selector or contain references exact same dom elements."
so example, following equate false
:
$( "#logo" ) === $( "#logo" )
why jquery objects unique?
thanks
because, essentially, jquery using factory pattern creates new instance of jquery object selector each time call it.
as these different instances, not equal.
Comments
Post a Comment