Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

basics of switch case and if else

//switch case
let marks=91;

switch(true){
    case (marks>90):
        console.log("Super Grade");
        break;
    case (marks > 50):
        console.log("Pass");
        break;
    case (marks < 50):
        console.log("Fail");
        break;
    default:
        console.log("Unknown Grade")
}


//If Else

let mark=91;

if (mark > 90) {
       console.log("Super Grade");
} else if (marks > 50){
     console.log("Pass");
}else if(marks < 50 ){
    console.log("Fail");
}else{
    console.log("Unknown Grade")
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: React Native drawer navigation screen header title and buttons 
Javascript :: javascript array foreach 
Javascript :: Enqueuing JavaScript in WordPress 
Javascript :: prisma decimal 
Javascript :: declare int in javascript 
Javascript :: listen to all events on an html element 
Javascript :: promises chaining 
Javascript :: js localstorage clear 
Javascript :: spread and rest operator javascript 
Javascript :: js regex return null 
Javascript :: what is package.json 
Javascript :: make forn awesome icon clickable in react 
Javascript :: jest write test for function 
Javascript :: js round to x decimal places 
Javascript :: multilone input react 
Javascript :: js dataset 
Javascript :: how fetch multiple data in javascript react 
Javascript :: how to proxy enable in server nodejs 
Javascript :: check variable value and do something 
Javascript :: get props from methods in vue 
Javascript :: await javascript 
Javascript :: why to use arrow functions over normal function 
Javascript :: javascript remove element from array in foreach 
Javascript :: javascript detect when youtube video ends 
Javascript :: get width of html photo 
Javascript :: react redux form validation 
Javascript :: react navigation params 
Javascript :: How to display multiple input value in JavaScript 
Javascript :: how i get selected class of li in jquery 
Javascript :: Passing a state as a prop in react 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =