About 428,000 results
Open links in new tab
  1. JavaScript Array Search - W3Schools

    The indexOf() method searches an array for an element value and returns its position. Note: The first item has position 0, the second item has position 1, and so on. Search an array for the …

  2. Four Different Ways to Search an Array in JavaScript

    Jun 24, 2020 · There are different methods in JavaScript that you can use to search for an item in an array. Which method you choose depends on your specific use case. For instance, do you …

  3. Array.prototype.find() - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · The find() method of Array instances returns the first element in the provided array that satisfies the provided testing function. If no values satisfy the testing function, undefined is …

  4. javascript - Check if an element is present in an array - Stack Overflow

    In modern browsers which follow the ECMAScript 2016 (ES7) standard, you can use the function Array.prototype.includes, which makes it way more easier to check if an item is present in an …

  5. JavaScript - Search An Item in an Array - GeeksforGeeks

    Jan 23, 2025 · Here are the different methods to search for an item in an array in JavaScript. 1. Using indexOf () The indexOf () method searches for a specified value in an array and returns …

  6. Four Methods to Search Through Arrays in JavaScript

    Dec 15, 2021 · In this article, you will learn about Array.includes(), Array.indexOf, Array.find(), and Array.filter. If you would like to follow along with this article, you will need: Familiarity with …

  7. JavaScript Array find () Method

    In this tutorial, you will learn how to use the JavaScript find() method to search for the first element in an array, which satisfies a test.

  8. Four Different Ways to Search an Array in JavaScript

    Aug 13, 2024 · In this comprehensive guide, we‘ll explore four essential methods for searching arrays in JavaScript: filter() find() includes() indexOf() We‘ll cover the syntax of each method, …

  9. How to check if an array contains a value in JavaScript

    May 25, 2020 · In JavaScript, there are multiple ways to check if an array includes an item. Apart from loops , you can use includes() , indexOf() , find() , etc. to check whether the given value …

  10. JavaScript Array find() Method - W3Schools

    The find() method returns the value of the first element that passes a test. The find() method executes a function for each array element. The find() method returns undefined if no …

  11. Some results have been removed
Refresh