let arr=[1,3,4,34]; let res= arr.filter(item=>{ return item>30; }); console.log(res); let btns= document.querySelectorAll("button"); btns=Array.prototype.filter.call(btns,item=>{ // btns=[].filter.call(btns,item=>{ return item.hasAttribute("class"); }); console.log(btns);