title: JavaScript Error : Unexpected end of input
body: <p>I am very new to JavaScript and i was making a tic tac toe game (following a tutorial) but i get an error: Unexpected end of input.</p>
  <pre><code>let board = [
    ['','',''],
    ['','',''],
    ['','',''],
  ];
  
  let players = ['X', 'O']
  
  let currentPlayer;
  let available = [];
  function setup() {
    frameRate(1);
    createCanvas(400, 400);
    currentPlayer = floor(random(players.length));
    for (let j = 0; j &lt; 3; j++){
      for (let i = 0; i &lt; 3;i++) {
        available.push([i, j]);
      }
    }
  
  }
  
  function eqauls3(a,b,c) {
    return (a==b &amp;&amp; b==c &amp;&amp; a != '');
  }
  
  function checkWinner() {
    let winner = null;
  
    //horizontal check
    for (let i = 0; i &lt; 3; i++) {
      if (equals3(board[i][0], board[i][1], board[i][2])) {
        winner = board[i][0];
      }
  
  // Vertical
      for (let i = 0; i &lt; 3; i++) {
        if (equals3(board[0][i] == board[0][i] == board[0][i])) {
          winner = board[0][i];
        }
    }
  
  // diagonal
  
  if (equals3(board[0][0] == board[1][1] == board[2][2])) {
    winner = board[0][0];
  }
  
  if (eqauls3(board[2][0] == board[1][1] == board[0][2])) {
    winner = board[2][0];
  }
  
  
    if (winner == null &amp;&amp; available.length == 0) {
      return 'tie';
    } else {
      return winner;
    }
  }
  
  function nextTurn() {
    let index = floor(random(available.length));
    let spot = available.splice(index, 1)[0];
    let i = spot[0];
    let j = spot[1];
    board[i][j] = players[currentPlayer];
    currentPlayer = (currentPlayer + 1) % players.length;
  }
  
  // function mousePressed() {
  //   nextTurn();
  // }
  
  
  function draw() {
    strokeWeight(4);
    background(255);
    let w = width / 3;
    let h = height / 3;
    line(w,0,w,height);
    line(w*2,0,w*2,height);
    line(0,h,width,h);
    line(0,h*2,width,h*2);
    for(let j = 0; j &lt; 3; j++) {
      for(let i = 0; i &lt; 3; i++) {
        let x = w * i + w/2;
        let y = h * j + h/2;
        textSize(32);
        let spot = board[i][j];
        if (spot == players[1]) {
          noFill();
          ellipse(x, y, w/2);
        } else if (spot == players[0]) {
          let xr = w/4;
          line(x-xr, y-xr, x+xr, y+xr);
          line(x+xr, y-xr, x-xr, y+xr);
        }
        //text(spot, x, y);
      }
    }
    let result = checkWinner();
    if (result != null) {
      noLoop();
      let resultP = createP('');
      resultP.style('font-size', '32pt');
      if (result == 'tie') {
        resultP.html('Tie!');
      } else {
        resultP.html(`${result} wins!`);
      }
    } else {
      nextTurn();
    }
  }
  </code></pre>
  <p>i cant seem to find a mistake(im a noob)
  Can someone help me?</p>