{"action":"closed","issue":{"url":"https://api.github.com/repos/ajhofferber/TicTacToe/issues/2","labels_url":"https://api.github.com/repos/ajhofferber/TicTacToe/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/ajhofferber/TicTacToe/issues/2/comments","events_url":"https://api.github.com/repos/ajhofferber/TicTacToe/issues/2/events","html_url":"https://github.com/ajhofferber/TicTacToe/issues/2","id":99669000,"number":2,"title":"Parameter Passing Issues","user":{"login":"ajhofferber","id":13276869,"avatar_url":"https://avatars.githubusercontent.com/u/13276869?v=3","gravatar_id":"","url":"https://api.github.com/users/ajhofferber","html_url":"https://github.com/ajhofferber","followers_url":"https://api.github.com/users/ajhofferber/followers","following_url":"https://api.github.com/users/ajhofferber/following{/other_user}","gists_url":"https://api.github.com/users/ajhofferber/gists{/gist_id}","starred_url":"https://api.github.com/users/ajhofferber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajhofferber/subscriptions","organizations_url":"https://api.github.com/users/ajhofferber/orgs","repos_url":"https://api.github.com/users/ajhofferber/repos","events_url":"https://api.github.com/users/ajhofferber/events{/privacy}","received_events_url":"https://api.github.com/users/ajhofferber/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"amadden80","id":1473668,"avatar_url":"https://avatars.githubusercontent.com/u/1473668?v=3","gravatar_id":"","url":"https://api.github.com/users/amadden80","html_url":"https://github.com/amadden80","followers_url":"https://api.github.com/users/amadden80/followers","following_url":"https://api.github.com/users/amadden80/following{/other_user}","gists_url":"https://api.github.com/users/amadden80/gists{/gist_id}","starred_url":"https://api.github.com/users/amadden80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amadden80/subscriptions","organizations_url":"https://api.github.com/users/amadden80/orgs","repos_url":"https://api.github.com/users/amadden80/repos","events_url":"https://api.github.com/users/amadden80/events{/privacy}","received_events_url":"https://api.github.com/users/amadden80/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-08-07T15:21:32Z","updated_at":"2015-08-07T16:00:32Z","closed_at":"2015-08-07T16:00:32Z","body":"UserStory\r\n\r\nAs a User, I want to be able to keep track of what spaces on the board are filled.\r\n\r\nTestStatement\r\n\r\nIn my make move function, I need to be able to keep track of spaces and whether they are being occupied by an X or an O. in order to do so, I want to pass an index value into my makeMove function that changes the index of my gameboard array to whatever letter is being placed at that index\r\n\r\nContext & Description\r\n\r\nI CANNOT figure out how to pass the index into the array. currently, each square on my board has an id. that correlates with it's position in the array. but because I set those id's in a separate function, I can't figure out how to pass those id's or index numbers into my makeMove function\r\n\r\n\r\nThis is the code where I create the individual cells\r\n```\r\nTicTacToeGameBoard.prototype.makeCell = function makeCell(cellIndex){\r\n  var gameCell = $('<div>').addClass('box');\r\n      gameCell.attr('id', cellIndex);\r\n  //var index = gameCell.attr('id');\r\n    return gameCell;\r\n```\r\n\r\nThis is the code for making the board, where I create the game board\r\n```\r\nTicTacToeGameBoard.prototype.makeBoard = function makeBoard(row, col){\r\n  var gameBoard = $('<div>').addClass('game-board');\r\n  var boardRow;\r\n  var newBox;\r\n    var cellIndex = 0;\r\n  for (var i = 0; i < row; i++){\r\n    boardRow = $('<div>').addClass('board-row');\r\n    for (var j = 0; j < col; j++) {\r\n      newBox = this.makeCell(cellIndex);\r\n      cellIndex++;\r\n      boardRow.append(newBox);\r\n    }\r\n    gameBoard.append(boardRow);\r\n  }\r\n  $('#center-section').append(gameBoard);\r\n\r\n  var scope = this;\r\n    $('.box').on('click', function(e){\r\n        var cell = $(e.target);\r\n          scope.makeMove(  cell,  cell.attr('id')   )\r\n        });\r\n  };\r\n```\r\n\r\nand this is the code where i want to pass the index/div id for each box\r\n```\r\nTicTacToeGameBoard.prototype.makeMove =  function makeMove(cell, index){\r\n//index = this.cell.attr('id')\r\n\r\n  if (this.board[index] === undefined){\r\n    if (this.turnCounter%2 === 0){\r\n      this.board[index] = 'O';\r\n      cell.text('O');\r\n    } else {\r\n      this.board[index] = 'X';\r\n      cell.text('X');\r\n    }\r\n        this.turnCounter++;\r\n        console.log(this.turnCounter)\r\n    };\r\n    if(this.board[index] !== undefined){\r\n      console.log('NOT HERE');\r\n    }\r\n    return this.board;\r\n\r\n};\r\n```"}}