var numbers = [10, 20, 30, 50, 235, 3000]; var result = numbers.filter(num => [1, 2, 5].includes(+String(num).charAt(0))); alert(result.join('; '));