--- id: 5d5a903507f328a948d398d0 title: Part 4 challengeType: 0 dashedName: part-4 --- # --description-- We've been declaring variables with the `var` keyword. However, in modern JavaScript, it's better to use `let` instead of `var` because it fixes a number of unusual behaviors with `var` that make it difficult to reason about. Change every `var` to `let`. # --hints-- See description above for instructions. ```js assert( /let\s+xp\s*\=\s*0\;?/.test(code) && /let\s+health\s*\=\s*100\;?/.test(code) && /let\s+gold\s*\=\s*50\;?/.test(code) && /let\s+currentWeapon\s*\=\s*0\;?/.test(code) ); ``` # --seed-- ## --before-user-code-- ```html RPG - Dragon Repeller
XP: 0 Health: 100 Gold: 50
Monster Name: Health:
Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
``` ## --after-user-code-- ```html ``` ## --seed-contents-- ```html ``` # --solutions-- ```html ```