Redefinition Of Length?
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? Fiddle
Solution 1:
window
already has length
defined:
window
already has length
defined:
If you had, say, an array:
howlong=myarray.length;
would return the number of elements in the array.
If you had a string:
howlong=mystring.length;
would return the number of characters in the string.
Long story short, 'length' is used all over the place. Most useful.
Post a Comment for "Redefinition Of Length?"