nested ternary operator

PHOTO EMBED

Mon Jun 17 2024 11:06:30 GMT+0000 (Coordinated Universal Time)

Saved by @davidmchale #loop #index #array

let score = 85;

let grade = (score >= 90) ? 'A' : 
            (score >= 80) ? 'B' : 
            (score >= 70) ? 'C' : 
            (score >= 60) ? 'D' : 'F';

console.log(`The grade is ${grade}`);
content_copyCOPY