function enterPlayersIntoBoard(chosenPlayerId) {
  var player1 = myId;
  let player2 = chosenPlayerId;

  //Make a new game with board number and who is playing
  let game = new window.exports.Game(-1, player1, player2);
  let json = JSON.parse(game.toJSON());

  $.ajax({
    //Send in a string accross to API
    type: 'POST',
    url: '/addGame',
    data: JSON.stringify(json),
    //If successful sending to sever change the id to myID rather than -1
    success: function (data) {
      player1 = myId;
      player2 = chosenPlayerId;
      localStorage.setItem
    },
    contentType: "application/json",
    dataType: 'json'
  });
}
/**
 * @function enterPlayersIntoBoard - Adding players to server
 */
@function enterPlayersIntoBoard - Adding players to server
@function enterPlayersIntoBoard - Adding players to server
function enterPlayersIntoBoard(chosenPlayerId) {
  var player1 = myId;
  let player2 = chosenPlayerId;
  let game = new window.exports.Game(-1, player1, player2);
  let json = JSON.parse(game.toJSON());
  $.ajax({
    type: 'POST',
    url: '/addGame',
    data: JSON.stringify(json),
    success: function (data) {
      player1 = myId;
      player2 = chosenPlayerId;
      localStorage.setItem
    },
    contentType: "application/json",
    dataType: 'json'
  });
}
function enterPlayersIntoBoard ( chosenPlayerId ) { var player1 = myId ; let player2 = chosenPlayerId ; let game = new window . exports . Game ( - 1 , player1 , player2 ) ; let json = JSON . parse ( game . toJSON ( ) ) ; $ . ajax ( { type : 'POST' , url : '/addGame' , data : JSON . stringify ( json ) , success : function ( data ) { player1 = myId ; player2 = chosenPlayerId ; localStorage . setItem } , contentType : "application/json" , dataType : 'json' } ) ; }
@function enterPlayersIntoBoard - Adding players to server
@function enterPlayersIntoBoard - Adding players to server
//Make a new game with board number and who is playing //Send in a string accross to API //If successful sending to sever change the id to myID rather than -1