We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Tutorials
  3. 10 Days of Javascript
  4. Day 2: Conditional Statements: If-Else
  5. Discussions

Day 2: Conditional Statements: If-Else

Problem
Submissions
Leaderboard
Discussions
Editorial
Topics

    You are viewing a single comment's thread. Return to all comments →

  • xXxAboodxXx
    2 months ago+ 0 comments
    function getGrade(score) {
        let grade;
        score <= 30 && score > 25 ? grade='A' : 
        score <= 25 && score > 20 ? grade='B' : 
        score <= 20 && score > 15 ? grade='C' :
        score <= 15 && score > 10 ? grade='D' :
        score <= 10 && score >  5 ? grade='E' :
        grade='F'
        
        return grade;
    }
    
    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy