Retrieve random element from array not contained in second array
The choice of the algorithm will depend on how many elements you have in your array, and how many of them you want to select. If you want to pull all names in random order, then shuffling is probably the best choice.

You can easily create a copy of names using names.slice() and shuffle the copy instead of the original array:

function randint(a, b) {
    return a + Math.floor(Math.random() * (b - a));
}

function shuffle(list) {
    list.forEach(function(value, i) {
        var j = randint(i, list.length);
        list[i] = list[j];
        list[j] = value;
    });
    return list;
}

var names  = ['Steve', 'Adam', 'Phillip', 'Thomas', 'John', 'Joseph'];
console.log(shuffle(names.slice()));


Alternatively, you can shuffle an array of numbers [0..N], and use them as indices to the names array:

function range(start, stop) {
    var list = [];
    for (var i = start; i &lt; stop; i++) {
        list.push(i);
    }
    return list;
}

var indices = shuffle(range(0, names.length));

indices.forEach(function(i) {
    console.log(names[i]);
});


Shuffling has a much better time complexity than the original algorithm. For an array of 1000 names, the innermost loop of the original algorithm is executes ~6 million times, while the innermost loop of the shuffle algorithm is executed only 1000 times.