Parse Integer in JavaScript
Level 128 keystrokes
parseInt() converts the string "42" into the number 42 and prints it.
JavaScript code
// parseInt() reads digits from the start of a string and returns an integer// "42" becomes 42; it stops at the first non-digit, so "42px" also gives 421console.log(parseInt("42"));Output
42
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this JavaScript code and how often they appear.
"× 2(× 2)× 2;× 1.× 1