https://www.codecademy.com/courses/learn-javascript/lessons/variables/exercises/create-a-variable
Im not actually trying to do that exercise im just trying to work on a game using that exercise to do it and add functions to the game when I learn more (I.E a combat system, store, etc)
There is no error message but it always outputs “zombie”
//stats
console.log (‘player stats’)
//output player name
var player = ‘mark’;
console.log(player)
//output player strength
var strength = ‘1’
console.log(‘strength’, strength)
//output player speed
var spd = ‘1’
console.log(‘speed’, spd)
//output player health
var HP = ‘10’
console.log (‘HP’, HP)
//choose next opponent
var chosenextopponent = (Math.floor (Math.random() *2));
if (nextopponent = 1) var nextopponent = (‘zombie’)
else if (nextopponent = 2) var nextopponent = (‘giant’)
//output next opponent
console.log (nextopponent)