Tell us what’s happening:
Your buyWeapon
function should increase currentWeapon
by 1
.
Am I wrong ? I can’t get past this step. Someone tech me please
Thanks in advance.
### My code below
function buyWeapon(currentWeapon) {
if (gold >= 30) {
gold -= 30;
currentWeapon += 1;
weapons[currentWeapon];
}
}
Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 85