Quick actions

cmd+k|ctrl+k

Navigation

Languages

Log all pairs of array

Snippet info

Language

JavaScript

Visibility

public

Author

lucassebold5

Created

2025-07-28T12:04:57.434729Z

Updated

2025-07-28T12:05:00.375299Z

// log all paris of array


const boxes = ['a', 'b', 'c', 'd', 'e'];

function logAllPairs(array){
    for(let i = 0; i < array.length; i++){
        for(let j = 0; j < array.length; j++){
            console.log(array[i], array[j])
        }
    }
}

logAllPairs(boxes);
INFO