| 1 |
// This Source Code Form is subject to the terms of the Mozilla Public |
| 2 |
// License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 |
// file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 |
|
| 5 |
js> parseInt |
| 6 |
function parseInt() { [native code for parseInt, arity=2] } |
| 7 |
js> parseInt("0"); |
| 8 |
0 |
| 9 |
js> parseInt("1") |
| 10 |
1 |
| 11 |
js> parseInt("-1") |
| 12 |
-1 |
| 13 |
js> parseInt(" 2") |
| 14 |
2 |
| 15 |
js> parseInt("3then some other chars") |
| 16 |
3 |
| 17 |
js> parseInt('0xF') |
| 18 |
15 |
| 19 |
js> parseInt('0xf') |
| 20 |
15 |
| 21 |
js> parseInt('010') |
| 22 |
8 |