--- id: 5d6f6bfc7c812010bf3327cc title: Part 53 challengeType: 0 --- # --description-- What if the player doesn't have enough gold to buy health? Put all the code in the `buyHealth` function inside an `if` statement. Here is an example of an `if` statement inside a function: ```js function checkMoney() { if (condition) { console.log("You have money!"); } } ``` Note: For now you should use the word "condition" inside the `if` statement but we'll be changing that next. # --hints-- See description above for instructions. ```js assert( buyHealth .toString() .match( /if\s*\(\s*condition\s*\)\s*\{\s*(gold|health|goldText|healthText)/ ) && buyHealth.toString().match(/gold\s*\-\=\s*10\;?/) && buyHealth.toString().match(/health\s*\+\=\s*10\;?/) && buyHealth.toString().match(/goldText\.innerText\s*\=\s*gold\;?/) && buyHealth.toString().match(/healthText\.innerText\s*\=\s*health\;?/) ); ``` # --seed-- ## --before-user-code-- ```html