var arrA = process.argv[3];
var arrB = [];

var sort = array => {
    var result = [];
    console.log(array);
    for (var j = array.length;j !== 0; j--) result.push(array[j]);
    console.log(result);
    return result;
}

for (var i = 1 ;i !== arrA.length; i--){
    arrB.push(arrA[i - 1]);
    sort(arrB);
}