var cars = [["A", "B", "C"],["D", "E", "F"],["G", "H", "I"]];
var diag = (cars.length*2) - 1
var result = [];
for(i = cars.length - 1; i >= 0; i--) {
for(j = cars.length - 1; j >= 0; j--) {
const x = i;
const y = diag - j;
if( x>= 0 && y<= diag) {
console.log(result)
}
}
Can someone help with this? Trying to start from bottom right to top left. I know I need a function too.