jQuery .size() and .length both return the number of elements in the jQuery object.
Size() and length in jQuery both returns the number of element in an object but length is faster than the size because length is a property and size is a method and length property does not have the overhead of a function call.
jQuery .size() and .length both return the number of elements in the jQuery object.
Size() and length in jQuery both returns the number of element in an object but length is faster than the size because length is a property and size is a method and length property does not have the overhead of a function call.
jQuery .size() and .length both return the number of elements in the jQuery object.
Size() and length in jQuery both returns the number of element in an object but length is faster than the size because length is a property and size is a method and length property does not have the overhead of a function call.
source: http://www.namasteui.com/difference-between-size-and-length-of-jquery/
Size is a method in jquery . It returns number of element in Jquery object. Both size and length return number of element. Size is a method and length is a property so length preferred over size to avoid method call overhead.
for Example
jQuery .size() method returns number of element in the object. But it is not preferred to use the size()method as jQuery provide .length property and which does the same thing. But the .length property is preferred because it does not have the overhead of a function call