17 lines
383 B
Plaintext
17 lines
383 B
Plaintext
The ``++parseInt++`` function has two versions, one that takes a base value as a second argument, and one that does not. Unfortunately using the single-arg version can result in unexpected results on older browsers.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
parseInt("010"); // Noncompliant; pre-2013 browsers may return 8
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
parseInt("010", 10);
|
|
----
|
|
|