Contact: aviboots(AT)netvision.net.il
43,934 questions
57,338 answers
573 users
const arr = ['javascript', 'typescript', 'nodejs', 'c']; if (!arr.includes('php')) { console.log('value is not in array'); } else { console.log('value is in array'); } /* run: "value is not in array" */
const arr = ['javascript', 'typescript', 'nodejs', 'c']; if (arr.indexOf('php') === -1) { console.log('value is not in array'); } else { console.log('value is in array'); } /* run: "value is not in array" */