Contact: aviboots(AT)netvision.net.il
39,987 questions
51,931 answers
573 users
const arr = [2, 'nodejs', 34, null, 9387, 20]; const onlyNumbers = arr.filter(element => typeof element === 'number'); console.log(onlyNumbers); /* run: [ 2, 34, 9387, 20 ] */