There are a variety of JavaScript idioms to perform this task.
One option is to flatten the array before running include such as the example Hassam Imam posted.
matrix.flat().includes(username)
Issues will arise however depending on how much data is stored in the multidimensional array.
Another option would be to what Konrad Linkowski suggested and leverage some.
matrix.some(array => array.includes(username))
This has a performance increase as it will stop after finding the first case that matches the provided criteria, but the result is boolean. If you just want to know if the value exists I would recommend this solution.
If you wish to know where in the matrix an element is you will want to use find instead of some as it will provide you the index in which it was found.
matrix.find(arr => array.includes(username));
Though this could get quite complex depending on how many dimensions the array has.
Let me know if you have any questions or would like to stub out what this solution may look like.
matrix.flat().includes(username)matrix.some(array => array.includes(username))includesjust simply iterates over array elements and checks equality, it can't know that the items are also arrays