I do not exactly get what you're trying to achieve, but an array in js could be filtered like this
let arr = [123,345,567,789]
let Search = 3
arr.filter(x=> x.toString().includes(Search))
// Result: [123,345]
Please let know if it helps or provide more information