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)

16th Sep 2020, 3:12 PM
LIDANIT
LIDANIT - avatar
3 Answers
+ 5
Gold is not > lev so nothing happens.
16th Sep 2020, 3:53 PM
Oma Falk
Oma Falk - avatar
+ 1
Thanks
16th Sep 2020, 4:23 PM
LIDANIT
LIDANIT - avatar
0
???
16th Sep 2020, 3:44 PM
LIDANIT
LIDANIT - avatar