When I try to create a variable named length
var length = 10;
JSLint complaints
Redefinition of 'length'. var length = 10;
But where does that length
come from?
When I try to create a variable named length
var length = 10;
JSLint complaints
Redefinition of 'length'. var length = 10;
But where does that length
come from?
If you had, say, an array:
would return the number of elements in the array.
If you had a string:
would return the number of characters in the string.
Long story short, 'length' is used all over the place. Most useful.
window
already haslength
defined:window.length : Window Object