**not sure if this is a peculiarity of browser editor **
if i use the .push method the console.log output of the returned value (big) looks like the same array, but the test fails [except first test parameter (top of list @ bottom left)]
.push method gives below.
anyone know why?
// running tests
largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]) should return [27, 5, 39, 1001].
largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) should return [9, 35, 97, 1000000].
largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]) should return [25, 48, 21, -3].
// tests completed
// console output
[ 27, 5, 39, 1001 ]
[ 27, 5, 39, 1001 ]
**Your code so far**
function largestOfFour(arr) {
for (let i=0;i<arr.length;i++){
let sub=arr[i]
let temp=sub[0]
for(let j=1;j<=sub.length;j++){
if(sub[j]>temp){temp=sub[j]}
}
big.push(temp)
// big[i]=temp
}
return big
}
let big = []
largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
console.log(big)
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Challenge: Return Largest Numbers in Arrays
Link to the challenge: