--- id: 5d67880ee0696bdec46938e3 title: Part 36 challengeType: 0 dashedName: part-36 --- # --description-- Now we are can consolidate the code inside the `goTown` and `goStore` functions. Copy the code inside the `goTown` function and paste it in the `update` function. Then delete all the code inside the `goTown` and `goStore` functions. # --hints-- See description above for instructions. ```js assert( (() => { update(); return ( goTown.toString() === 'function goTown() {}' && goStore.toString() === 'function goStore() {}' && button1.innerText === 'Go to store' && button2.innerText === 'Go to cave' && button3.innerText === 'Fight dragon' && text.innerText === 'You are in the town square. You see a sign that says "Store".' && update.toString().match(/button1\.onclick\s*\=\s*goStore\;?/) && update.toString().match(/button2\.onclick\s*\=\s*goCave\;?/) && update.toString().match(/button3\.onclick\s*\=\s*fightDragon\;?/) ); })() ); ``` # --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 ```