I am working with a basic 2D array that contains x, y coordinates as shown below:
var c = [
[1,10],
[2,11],
[3,12],
[4,13],
[5,15]
];
I want to know how I can extract pairs from the array that meet specific conditions for both x and y values, and then store those pairs in a new array. For example:
for each pair in c {
if (x > 3 && y > 13) {
push to NewArray
}
}
I am new to JavaScript and have not been able to find a solution online. Any help would be greatly appreciated.