How to check array contains value or not?



How to check array contains value or not?..

Answer / Ravindra Chaudhari

In JavaScript, you can use the indexOf() method to check if an array contains a specific value. If indexOf() returns -1, the array does not contain the specified value.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What is stack explain with diagram?

1 Answers  


What are skew trees? For a tree with 4 nodes draw all possible binary? Generalize for n nodes how many binary trees can be drawn?

1 Answers   Tech Mahindra,


How do I use quick sort?

1 Answers  


Write a program for Sorting an Array. Which sorting will you prefer?

0 Answers  


What is a hashers run?

1 Answers  


Why do we need linked list?

1 Answers  


What is stack algorithm?

1 Answers  


Explain merge sort algorithms.

1 Answers  


Define binary tree insertion.

1 Answers   Tech Mahindra,


How does arraylist size work?

1 Answers  


Define an algorithm. What are the properties of an algorithm?

1 Answers  


Define an abstract data type (adt)?

1 Answers  


Categories