Rewrite 'if' into '?'
importance: 5
Rewrite this if using the conditional operator '?':
let result;
if (a + b < 4) {
result = 'Below';
} else {
result = 'Over';
}
let result = (a + b < 4) ? 'Below' : 'Over';
We want to make this open-source project available for people all around the world.
Help to translate the content of this tutorial to your language!
Rewrite this if using the conditional operator '?':
let result;
if (a + b < 4) {
result = 'Below';
} else {
result = 'Over';
}
let result = (a + b < 4) ? 'Below' : 'Over';