In jquery both works and gives the same result but now the time in current version of jquery we use the
jquery.size is depreciated.
Below is the some points about this properties :
jquery.length() both returns the number of element in an object.
jquery.length() property is faster as compared to
jquery.length() property prefered compared to
size() because it does not have overhead of a function call.
Very significant difference is that
jquery.size() is depreciated so we always use
jquery.length() instead of
For Examples: Counts the number of unordered list li on the page to demonstrate the same according to the jQuery documentation.