34 lines
704 B
Plaintext
Raw Normal View History

2020-06-30 12:50:59 +02:00
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
2021-01-27 13:42:22 +01:00
No issue is reported when ``++arguments++`` is used in the body of the function being called.
2020-06-30 12:50:59 +02:00
2021-02-02 15:02:10 +01:00
2020-06-30 12:50:59 +02:00
----
function doSomething(a, b) {
compute(arguments);
}
doSomething(1, 2, 3) // Compliant
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]