Help with nesting loops

Hi guys, Im struggling with overcoming another hurdle creating a custom booking platform. I believe I need to nest loops to achieve my goal but despite weeks of reading and logging various attempts I cant figure out how to write the code to make things happen in the desired order. Is there a way to make the nested loops run so that they’d do this …


const letters = ['A', 'B'];
const numbers = [1,2,3];
for(i = 0; i < letters.length; i++){
    for(i = 0; i < numbers.length; i++){   
    }
}
// 0. A1
// 1. A2
// 2. A3
// 3. B1
// 4. B2
// 5. B3


Instead of …

const letters = ['A', 'B'];
const numbers = [1,2,3];

// 0. A1
// 1. B1
// 2. A2
// 3. B2
// 4. A3
// 5. B3

Swap position of the 2 loops: first increment numbers, then letters. Also, it’s preferable to use i, j, k etc when you loop inside a loop, to distinguish.