--- id: 5ddb965c65d27e1512d44db0 title: Step 25 challengeType: 0 dashedName: step-25 --- # --description-- Use a ternary operator to assign the value of `maxCalories`. A ternary operator has the following syntax: `condition ? expressionTrue : expressionFalse`. For example, `(5 - 3 === 4) ? "Yes" : "No"` does the same thing as the following if else statement: ```js if (5 - 3 === 4) { return 'Yes'; } else { return 'No'; } ``` `document.getElementById('female').checked` will return either `true` if it is checked or `false` if it isn't. Use a ternary operator to return 2000 if it is is checked and 2500 if it is not. # --hints-- See description above for instructions. ```js assert( /const\s*maxCalories\s*=\s*document\.getElementById\([\'\"\`]female[\'\"\`]\)\.checked\s*\?\s*2000\s*\:\s*2500/.test( code ) ); ``` # --seed-- ## --before-user-code-- ```html

Calorie Counter

Sex
Breakfast
Lunch
Dinner
``` ## --after-user-code-- ```html ``` ## --seed-contents-- ```html ``` # --solutions-- ```html ```