39 lines
548 B
Plaintext
39 lines
548 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
function pickNumber() {
|
|
let i = 0;
|
|
i = i++; // Noncompliant; i is still zero
|
|
|
|
return i++; // Noncompliant; 0 returned
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
function pickNumber() {
|
|
let i = 0;
|
|
i++;
|
|
|
|
return ++i;
|
|
}
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|