JSFiddle - React, Tailwind, and code Playground

JavaScript

var set = [NaN, "", null, 0, 1, 2, "Foo", "5"];

console.log(set.map(Number).filter(function(val) { return typeof val == 'number' && !isNaN(val); }))

console.log(set.filter(function(val) { return typeof val == 'number' && !isNaN(val); }))