0
What is wrong here?/Что здесь не так?
let level = 1; let updateLevel = 1; let gold = 100; function updating(lev) { if(gold >= lev){ let notCost = (lev - gold); if(notCost > 0) { console.log('Вам не хватает/You are missing ' + notCost + ' монет/coins') }if(level === 1) { gold = gold - 300; }if(level === 2) { gold = gold - 500; }; level = level + updateLevel; return lev; } }; updating(300); console.log(level); console.log(gold); updating(500); console.log(level); console.log(gold)
3 Answers
+ 5
Gold is not > lev so nothing happens.
+ 1
Thanks
0
???