Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Instruction

checkForWin() Method Challenge Solution

checkForWin() Method Solution

/** 
 * Checks if there a winner on the board after each token drop.
 * @param   {Object}    Targeted space for dropped token.
 * @return  {boolean}   Boolean value indicating whether the game has been won (true) or not (false)
 */

checkForWin(target){
    const owner = target.token.owner;
    let win = false;

    // vertical
    for (let x =...