- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Following is the code −
var nameList = [ "John", "David", "Bob", "Carol", "Sam" ] console.log(nameList.includes("Bob")); console.log(nameList.includes("Adam"));
To run the above program, you need to use the following command −
Here, my file name is demo286.js.
This will produce the following output on console −
- Does SQL Server have an equivalent to MySQL's ENUM data type?
- Kotlin equivalent of Java's equalsIgnoreCase
- What's the Kotlin equivalent of Java's String?
- How do you check if an element is present in a list in Java?
- Sort an arrays of 0’s, 1’s and 2’s using C++
- Sort an arrays of 0’s, 1’s and 2’s using Java
- How do make a flat list out of list of lists in Python?
- Check if a list exists in given list of lists in Python
- Segregate 0’s and 1’s in an array list using Python?