In order to achieve my goal, I am looking for a way to take an array
as input and save the result
for future use. Unfortunately, I do not have permission to create additional functions. As a result, the code must accurately reflect what result
should be.
let array = [[1,2,3,4,5,10],[1,2,3,4,5,20]];
let result;
array.forEach(function(el) {
if(el[5] == 10) {
result = el; //need to store this value in a variable
}
});
I realize that something is missing here and I can't seem to pinpoint what it is. Any guidance on how to make this implementation successful would be greatly appreciated.