36 lines
586 B
Plaintext
36 lines
586 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,javascript]
|
|
----
|
|
function getLength(a, b, c) {
|
|
const strings = []; // Noncompliant
|
|
strings.push(a);
|
|
strings.push(b);
|
|
strings.push(c);
|
|
|
|
return a.length + b.length + c.length;
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,javascript]
|
|
----
|
|
function getLength(a, b, c) {
|
|
return a.length + b.length + c.length;
|
|
}
|
|
----
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|