let newArray = [];
for(let i = 0; i < allItems.length; i++){
let item = allItems[i];
if(item.value == 'hi' || item.value.indexOf('h') > -1){
// add to new array.
newArray.push(item.id);
// Or store the whole object:
newArray.push(item);
}
}
This is fairly basic stuff when working with arrays in javascript. What did you try before this?
Also, in my opinion, you definitely don't need a library to do this.