DEV Community

Cover image for switch case of if, if else and else as default
Kapgeradok
Kapgeradok

Posted on

switch case of if, if else and else as default

_**//switch case of if, if else and else as default **_
function Major(Engineering){
    switch(Engineering){
        case 'Software Engineering':
            return 'Its a course of heroes, You can be proud of!' 
        case 'Cevil Engineering' :
            return 'Oops! that deals with construction!'
        default : 
            return `Which type of ${Engineering}?`
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)