how to print every array number combination possible

JavaScript
var a = [0,1,2,3,4,5,6,7,8,9]
var b = [9,8,7,6,5,4,3,2,1,0]

for(var i = 0;i < a.length;i++){
    for(var j = 0; j < b.length; j++){
    console.log(a[i],b[j]);
    }
}
Source

Also in JavaScript: