CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Two Ternary Expressions

JavaScript code walkthrough · Question 15
easyOperators

Code

Read carefully. What does this print?
1let score = 72;
2let grade = score >= 60 ? "pass" : "fail";
3console.log(grade);
4let n = 4;
5console.log(n % 2 === 0 ? "even" : "odd");

Your answer