Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (17 loc) · 555 Bytes

no-extra-arguments.md

File metadata and controls

25 lines (17 loc) · 555 Bytes

no-extra-arguments

You can easily call a JavaScript function with more arguments than the function needs, but the extra arguments will be just ignored by function execution.

Noncompliant Code Example

function say(a, b) {
  print(a + ' ' + b);
}

say('hello', 'world', '!'); // Noncompliant; last argument is not used

Exceptions

No issue is reported when arguments is used in the body of the function being called.

function doSomething(a, b) {
  compute(arguments);
}

doSomething(1, 2, 3); // Compliant