Loading ...
Sorry, an error occurred while loading the content.

2868Re: Early Unused Arguments

Expand Messages
  • douglascrockford
    Apr 30, 2012
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "benquarmby" <ben.quarmby@...> wrote:

      > This argument aside (ba-dum-tish!), my real question is whether JSLint should allow early unused arguments. So translating my earlier sample:
      >
      > anythingFromAnyApi.onSomeEvent = function (a, b) {
      > iAmUsing(b);
      > };
      >
      > Should JSLint warn that "a" is unused when I can't control the number of arguments in this case?


      Yes it should, because it is often an error. But if you are intentionally writing code that looks like an error, and don't want to be reminded of that fact, then use the Tolerate unused parameters option.
    • Show all 11 messages in this topic