--- id: 5d80d67021b11cdaa3f6b167 title: Part 116 challengeType: 0 --- # --description-- The conditional operator, also called the ternary operator, can be used as a one line if-else expression. The syntax is: `condition ? statement-if-true : statement-if-false;`. Change the if-else expression from the last challenge to use the ternary operator instead. Here is an example: ```js if (age >= 18) { adultFunction(); } else { kidFunction(); } // The above if-else expression does the same thing as the following line age >= 18 ? adultFunction() : kidFunction(); ``` # --hints-- See description above for instructions. ```js assert( attack .toString() .match( /^\s*\}\s*else\s*if\s*\(\s*monsterHealth\s*\<\=\s*0\s*\)\s*\{\s*fighting\s*\=\=\=\s*2\s*\?\s*winGame\(\s*\)\s*\:\s*defeatMonster\(\s*\)\;?\s*\}/m ) ); ``` # --seed-- ## --before-user-code-- ```html