Get warning when passing too few arguments to a javascript function
问题 Is there a tool that can help me detect when a javascript function is being passed too few arguments? As far as I can tell, neither JSLint nor JSHint provides this feature. Just be make it clear, if I write: some_method = function(x,y) { // ..do stuff } some_method(2); I would like to be warned, that I might have to pass in another argument. 回答1: You can't do that, all parameters are always optional and you can pass an indefinite amount of parameters to a parameterless function (through the