---
title: "Search for a value in an array through JavaScript"  
description: "Search for a value in an array through JavaScript"  
author: "Anonymous User"  
published: 2021-07-20  
updated: 2021-07-20  
canonical: https://www.mindstick.com/forum/156567/search-for-a-value-in-an-array-through-javascript  
category: "javascript"  
tags: ["javascript", "array"]  
reading_time: 1 minute  

---

# Search for a value in an array through JavaScript

What is the most concise and [efficient](https://www.mindstick.com/articles/33637/three-tips-for-an-energy-efficient-home-for-2019) way to find out if a [JavaScript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript) [array contains](https://www.mindstick.com/forum/23089/in-java-how-can-i-test-if-an-array-contains-a-certain-value) a [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages)?

## Replies

### Reply by Anonymous User

The include() method in JavaScript returns a boolean value true or false if it contains the desired value. The include() method is case sensitive i.e., it will treat uppercase characters and lowercase characters differently.

Let's understand it with the help of an example :

```
<!DOCTYPE html>
<html>
<body>
    <p id='demo'></p>
    <script>
        var str = 'Mindstick Software Private Limited';
        var check = str.includes('ind');
        document.getElementById('demo').innerHTML = check;
    </script>
</body>
</html>
```

Hope this code will be helpful for you.

Happy Coding!


---

Original Source: https://www.mindstick.com/forum/156567/search-for-a-value-in-an-array-through-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
