size and method both returns the same legth but length is faster than size coz size is a method
Interviews11 answers
What is the difference between size and length of jQuery?
11 Answers
Bidyasagar MishraPosted Jul 12, 2019, 2:09 AM EDT
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.
Tekesh BisenPosted Jun 21, 2017, 11:16 PM EDT
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.
Tekesh BisenPosted Jun 21, 2017, 11:16 PM EDT
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/
Sourav BasakPosted Sep 14, 2015, 10:03 PM EDT
Both size and length return number of character but compare to size, length is fast beacuse size is method and length is property.
Vaibhav SalwePosted May 30, 2015, 3:33 AM EDT
Size and length 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.
Posted May 8, 2015, 4:02 AM EDT
http://stackoverflow.com/questions/2738352/jquery-size-method-vs-length-attribute
Munesh SharmaPosted Mar 29, 2015, 8:13 PM EDT
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
- A
- B
Navin KumarPosted Feb 27, 2015, 5:27 AM EST
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
Munesh SharmaPosted Jan 29, 2015, 2:13 AM EST
Agree with Mr. Nitin.
In addition you can test from here : http://jsperf.com/size-vs-length
Md. Raskinur RashidPosted Jan 27, 2015, 11:25 PM EST
Size and length 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.
Nitin ChoudharyPosted Jan 20, 2015, 2:53 AM EST





