I'm having a problem getting .push to add an additional value to an array on any push beyond the first.
var player_score = [];
function updatePlayerScore(x) {
player_score.push(x);
console.log(player_score);
}
The first time I call updatePlayerScore(x) with a value of 2, the array is successfully updated with [2] and displays in the console.
The next time I call updatePlayerScore(x) with any value (i.e. 4) an error is thrown "Uncaught TypeError: player_score.push is not a function"
.push()is not a function. Is there changing the reference ofplayer_score?player_score.pushis not a function.