DEV Community

Kapgeradok
Kapgeradok

Posted on

The short-form of if else statement

The short form of if else statement as used in JavaScript

// here is a short-form of if else statement:
function Major(Engineering){
    return Engineering === 'Software Engineering' ? 
    "It's a course of heroes, You can be proud of!" :
    `Which type of ${Engineering}?`;
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)