Question: I have a set of arrays :

```
var arr = [ 
[ 'AAAA.10', 'S10' ],
[ 'AAAA.10', 'S11' ],
[ 'AAAA.12', 'S12' ],
[ 'AAAA.13', 'S13' ],
[ 'AAAA.14', 'S14' ] ]

```

I want to search the array values if any matches found i want to return whole array.

If im searching like `10` then it should check for array values if matches found (So the match is `AAAA.10`) then it should return whole array like this: `[[ 'AAAA.10', 'S10' ], [ 'AAAA.10', 'S11' ]]`.

I tried with the code below but its not working :

```
console.log(arr.find('10'));

```

Please help me to achieve the output.

Answer: 
Using `forEach` and `find`

```js
var arr = [
  ['AAAA.3', 'S3'],
  ['AAAA.4', 'S4'],
  ['AAAA.5', 'S5'],
  ['AAAA.6', 'S6'],
  ['AAAA.7', 'S7'],
  ['AAAA.8', 'S8'],
  ['AAAA.9', 'S9'],
  ['AAAA.10', 'S10'],
  ['AAAA.10', 'S11'],
  ['AAAA.12', 'S12'],
  ['AAAA.13', 'S13'],
  ['AAAA.14', 'S14']
];
var arr1 = [];

function a(str) {
  arr.forEach(e => {
    e.find(x => {
      if (x.includes(str)) {
        arr1.push(e)
      }
    })
  })
}
a('10');
console.log(arr1);
```
You can try this code:

```js
var arr = [ [ 'AAAA.3', 'S3' ],
[ 'AAAA.4', 'S4' ],
[ 'AAAA.5', 'S5' ],
[ 'AAAA.6', 'S6' ],
[ 'AAAA.7', 'S7' ],
[ 'AAAA.8', 'S8' ],
[ 'AAAA.9', 'S9' ],
[ 'AAAA.10', 'S10' ],
[ 'AAAA.10', 'S11' ],
[ 'AAAA.12', 'S12' ],
[ 'AAAA.13', 'S13' ],
[ 'AAAA.14', 'S14' ] ];

function search(index){
  for(i = 0; i<=arr.length-1; i++){
    if(arr[i].indexOf(index)>-1){
      console.log(arr[i]);
    }
  }
 }

 search("AAAA.10");
```