if
is not an expression, meaning it does not return a value. A ternary is an expression, meaning it does return a value. This allows you to use it on the right hand side of an assignment operator.
So when assigning things, this is needlessly verbose
var someEl = document.getElementById('some-element');
if (isCool) {
someEl.innerText = 'totally cool';
} else {
someEl.innerText = 'NOT COOL YO';
}