jQuery size() method vs length attribute
Length returns the same thing and is slightly faster according to the jQuery documentation.
Source: http://api.jquery.com/size/
No. size()
returns length
. By using length
you only avoid one extra method call.
They will both give you the same result but .length is slightly faster.
See http://api.jquery.com/size/:
The .length property is a slightly faster way to get this information.