javascript - length property of functions -
i don't understand what's going on here:
$ node > var f = function() {}; > f['length'] = '11'; '11' > f['length'] 0 if you're not familiar node, code after > typed, , stuff not there returned values. f['length'] == 0.
length property functions number of arguments function expects.
specifies number of arguments expected function.
https://developer.mozilla.org/en/javascript/reference/global_objects/function/length
in case, f doesn't take paramater, length 0.
Comments
Post a Comment