Use Array.some method which will tests whether at least one element in the array passes the test

const ELEMENT_DATA = [{
    position: 1,
    name: 'Hydrogen',
    weight: 1.0079,
    symbol: 'H'
  },
  {
    position: 2,
    name: 'Helium',
    weight: 4.0026,
    symbol: 'He'
  },
  {
    position: 3,
    name: 'Lithium',
    weight: 6.941,
    symbol: 'Li'
  },
  {
    position: 4,
    name: 'Beryllium',
    weight: 9.0122,
    symbol: 'Be'
  }
];
let m = ELEMENT_DATA.some(function(item) {
  return item.name === 'Helium'
});
console.log(m)

Answer from brk on Stack Overflow
🌐
Programiz
programiz.com › javascript › multidimensional-array
JavaScript Multidimensional Array
In JavaScript, multidimensional arrays contain another array inside them.
Discussions

Arr.includes(item) - Problem with Multidimensional Arrays
I’m trying to use the arr.includes(item). The function should return True if the item is an element of the array. But it doesn’t seem to be able to do so with a multidimensional array. Take a look at this screenshot (running node in the console): Is it because it’s an EC6 function, and ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
May 25, 2017
javascript - How to check if a two dimensional array includes a string? - Stack Overflow
I have a two dimensional array arr[cols][rows]. I want to know if the cols contains a string "hello". How can I check that using .includes("hello") method. Please note that I am trying to check this More on stackoverflow.com
🌐 stackoverflow.com
Check if an Item exists in a multidimensional Array - JavaScript - SitePoint Forums | Web Development & Design Community
Hello all, The following code returns the index of an Item if it is found in a multidimensional array. The problem with it is that if the item is not found it results in an error and stops executing the rest of my code. I’ve tried to let it return a -1 index if not found but it keeps on telling ... More on sitepoint.com
🌐 sitepoint.com
0
September 25, 2015
How do you make a deep copy of an array in Javascript?
To all following commenters: please, do not bring up the old circlejerk jokes/memes about recursion ("Understanding recursion...", "This is recursion...", etc.). We've all heard them n+2 too many times. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/learnprogramming
6
1
July 22, 2024
🌐
EDUCBA
educba.com › home › software development › software development tutorials › javascript tutorial › multi-dimensional array in javascript
Multi-Dimensional Array in JavaScript | Properties & Top 8 Methods Used
March 17, 2023 - Multidimensional arrays in JavaScript provides the facility to store different types of data into a single array with each element inner array capable of storing independent data from the rest of the array with its length, which cannot be achieved ...
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
StudySmarter
studysmarter.co.uk › explanations › computer-science › computer-programming › javascript-multidimensional-arrays
StudySmarter | The #1 learning app for university & school
StudySmarter is an intelligent learning app for students. Achieve your learning goals with more structure, motivation & efficiency. ⭐ Sign up now!
🌐
freeCodeCamp
forum.freecodecamp.org › t › arr-includes-item-problem-with-multidimensional-arrays › 119680
Arr.includes(item) - Problem with Multidimensional Arrays
May 25, 2017 - I’m trying to use the arr.includes(item). The function should return True if the item is an element of the array. But it doesn’t seem to be able to do so with a multidimensional array. Take a look at this screenshot (running node in the console): Is it because it’s an EC6 function, and not yet completely functional?
🌐
GeeksforGeeks
geeksforgeeks.org › javascript-multidimensional-array
JavaScript Multidimensional Array | GeeksforGeeks
A multidimensional array in JavaScript is an array that contains other arrays as its elements.
Published: April 24, 2025
🌐
TutorialsTonight
tutorialstonight.com › js › javascript-multidimensional-array
Javascript Multidimensional Array (with Examples)
JavaScript does not provide any built-in support for multidimensional arrays. There is no direct way to create a multidimensional array in JavaScript.
Find elsewhere
🌐
Zenva
gamedevacademy.org › home › web development › frontend development › a useful introduction to javascript multidimensional arrays
A Useful Introduction To JavaScript Multidimensional Arrays - GameDev Academy
Multidimensional JavaScript Arrays are basically JavaScript Arrays of arrays . For example: let mArr = [[1,2,3],[4,5,6,7]]. This allows for an intuitive way to store 2D, 3D, or even higher dimensional values.
Published: October 21, 2023
🌐
LogRocket
blog.logrocket.com › home › 5 best javascript multidimensional array libraries
5 best JavaScript multidimensional array libraries - LogRocket Blog
June 4, 2024 - Learn more about the 5 best JavaScript libraries for dealing with multidimensional arrays, such as ndarray, math.js, and NumJs.
🌐
Medium
benandengineering.medium.com › using-multidimensional-array-in-javascript-5ff15bdae8bd
Using multidimensional array in JavaScript | by Ben And Engineering | Medium
March 11, 2023 - Okay, now the next part is how to loop multidimensional array in JavaScript. We want to create multidimensional array, so we need to think of one main thing: Nesting Levels. The nesting levels are what translate to the N dimensions of the array.
🌐
Better Programming
betterprogramming.pub › check-if-an-array-is-within-a-2d-array-using-javascript-c534d96cb269
Check if an Array Is Within a 2D Array Using JavaScript | by Matt Cummings | Better Programming
March 9, 2020 - By iterating through an array and comparing the value of elements at the same index, we can see if they are truly the same. I’ve come up with a solution. It can probably be optimized, but the way it works is straightforward to me and I’ll be going over my rationale for its construction as we dive in. I’ll also go over some optimizations I’ve made to cut down on runtime. Pass-by-reference can pose a unique problem in JavaScript.
🌐
SitePoint
sitepoint.com › javascript
Check if an Item exists in a multidimensional Array - JavaScript - SitePoint Forums | Web Development & Design Community
September 25, 2015 - The following code returns the index of an Item if it is found in a multidimensional array.The problem with it is that if the item is not found it results in an error and stops executing the rest of my code. Here is a script that sorts out your problem areas and allows you to find the target string anywhere in your sub arrays. <script type="text/javascript"> var myArray = [ ["AA", "Walter", "White", "Albuquerque"], ["Skyler", "White", "Albuquerque", "RY"] ]; var testIt="RY"; var i=0, k=0, indx=[], msg; for ( i=0; i<myArray.length; i++) { for ( k=0; k<myArray[i].length; k++) { if (myArray[i][k] === testIt){ indx = [i,k]; break; } } } if(typeof indx[0] == "undefined" || typeof indx[1] == "undefined"){ msg=("Not found"); } else { msg="i= "+indx[0]+" k= "+indx[1]; } alert(msg); // </script>
🌐
LinkedIn
linkedin.com › pulse › exploring-multidimensional-arrays-javascript-laurence-svekis-
Exploring Multidimensional Arrays in JavaScript
September 20, 2023 - Multidimensional arrays are an extension of one-dimensional arrays (regular arrays) that allow you to store data in a tabular format, like a grid or a matrix. In JavaScript, multidimensional arrays are essentially arrays of arrays.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-check-if-an-item-exists-in-a-multidimensional-array-in-javascript
How to Check if an Item Exists in a Multidimensional Array in JavaScript? - GeeksforGeeks
November 14, 2024 - includes(): This method checks if a given value exists in an array. If you want to search through all elements of a multidimensional array without considering sub-array boundaries, you can first flatten the array using flat() and then check ...
🌐
Scaler
scaler.com › home › topics › what is a multidimensional array in javascript?
Multidimensional Array in JavaScript - Scaler Topics
July 14, 2024 - A multidimensional array is not present natively in JavaScript. Hence there is no direct way to create a multidimensional array in JavaScript.