JavaScript
If else statement

by Sagar Karira

let value;
if (condition) {
    value = 5;
} else { 
    value = 10;
}

let value = 10; 
if (condition) {
    value = 5;
}

Another solution could be: let value = (condition) ? 5 : 10; :)

Benny Neugebauer

I like this one..

Lipis

Sign in to comment!