Open this example in the interactive library
Source code
console.log([4, NaN, Infinity, "4"].map(Number.isFinite));
Sample output
[ true, false, false, false ]

Validate finite numbers. A self-contained example using the JavaScript runtime.
Open this example in the interactive library
console.log([4, NaN, Infinity, "4"].map(Number.isFinite));
[ true, false, false, false ]