filter 2d array javascript
function filterByPosition(array, number, position) {
return array.filter(innerArray => innerArray[position - 1] !== number);
}
const items = [
[1, 1, 2, 4],
[2, 1, 4, 6],
[5, 6, 4, 1],
[1, 6, 3, 1]
];
const newItems1 = filterByPosition(items, 1, 2);
console.log('Items1:', newItems1);
const newItems2 = filterByPosition(items, 4, 3);
console.log('Items2:', newItems2);
Also in JavaScript:
- choose random from array javascript
- javascript confirm yes no
- react environment variables
- regex for lowercase letters js
- service worker js example
- Aspect Ratio height react
- passing livewire variable in alpine js
- how to convert string to int js
- js filter
- javascript if equal infinity
- adjust() js
- Javascript clear canvas
- vendor.min.js download stackover
- htmlWebpackPlugin.options.title
- javascript redirect to a page
- nodejs express routing get
- javascript algorithms
- javascript convert seconds to minutes seconds
- chrome add bookmark that prefixes text
- how to create duplicate key array in javascript
- Use the conditional operator in the checkEqual function to check if two numbers are equal or not. The function should return either "Equal" or "Not Equal".
- three dots in javascript
- enable version 12 node glitch
- nodejs readdir