Check Finite in JavaScript

Level 133 keystrokes

Number.isFinite() checks whether 42 is a finite number and prints true.

JavaScript code

// Number.isFinite() returns false for Infinity, -Infinity and NaN
// 42 is an ordinary number, so true; non-numbers like "42" give false
1console.log(Number.isFinite(42));

Output

true
Practice typing this code

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

More JavaScript examples at level 1

← JavaScript typing practice