you could create a hash.
var ar = [
[2,6,89,45],
[3,566,23,79],
[434,677,9,23]
];
var hash = {};
for(var i = 0 ; i < ar.length; i += 1) {
hash[ar[i]] = i;
}
var val = [434,677,9,23];
if(hash.hasOwnProperty(val)) {
document.write(hash[val]);
}
More Related Contents:
- In javascript, how do you search an array for a substring match
- Why Array.indexOf doesn’t find identical looking objects
- Search array of objects for entry matching variable and check if it matches other fields
- How to search for a string inside an array of strings
- Get the item that appears the most times in an array
- How to find a value in an array of objects in JavaScript?
- Find closest date in array with JavaScript
- Filter JSON by key value with JavaScript
- compare each 5 numbers of two array [closed]
- fetch first element of every string in array using javascript [closed]
- Convert string into several integer arrays [duplicate]
- Best way to find if an item is in a JavaScript array? [duplicate]
- Most efficient way to create a zero filled JavaScript array?
- Sort array of objects by single key with date value
- How to group by and sum an array of objects? [duplicate]
- Group objects by multiple properties in array then sum up their values
- What is “undefined x 1” in JavaScript?
- Check if an array is empty or exists
- Sorting objects by property values
- Get unique results from JSON array using jQuery
- Getting a list of associative array keys
- How to find duplicate values in a JavaScript array of objects, and output only unique values?
- How much faster are arrays than accessing Google Sheets cells within Google Scripts?
- Getting index of an array’s element based on its properties
- JavaScript filter array by data from another
- Sum two arrays in single iteration
- What is the difference between “in operator” and “includes()” for JavaScript arrays
- How do I unset an element in an array in javascript?
- How are JavaScript arrays implemented?
- Converting Array of Objects into Array of Arrays