This is my array.
I want to get the sub-arrays where the first element is “admin”.
const array = [["admin", 1234], ["user", 999], ["admin", 5555]];
The expected output should look like this:
[admin,1234], [admin,5555]
New contributor
John Lee Cordova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.