var a = array[3].map(el=>el.object); if(a.includes(5) && a.includes(2)) else if(a.includes(5)) else if(a.includes(2))