switch case grade and age

 const grade = 'a';


switch (grade) {

  case "a":

    console.log("very good")

    break;

    

  case "b":

    console.log("good");

    break;

    

  case "c":

    case "c":

      console.log("need improvement");

    break

    case "d":

      console.log("not good");

    break

    case "e":

      console.log("fail");

    break

  default:

    console.log("this not valid grade")

}


---------------------------------------------------------------------------------


let a = 102;

switch (a){

  case 12:

    console.log("your age is 12")

    break;

  case (15):

    console.log("your age is 15")

    break

  case (18):

    console.log("your age is 18")

    break

  default:

    console.log("your age is not special")   

}

Comments

Popular posts from this blog

practice test of Arithmetic Operations: