Function to alternate players' turns, unless a player has won
You could return the same player if win is true, otherwise return the other player, this is done with only 2 tests:

function whoseMove(lastPlayer, win) {
    if (win) return lastPlayer;
    return lastPlayer == "black" ? "white" : "black";
}