name = 'Jack' let isUserJack = name === 'Jack' ? true : false
Unlike IF/Else conditional logic, the ternary value can be returned and stored to a variable. In this case isUserJack holds the boolean value of true.
Using ternary expressions is also very clean.
Keep in mind though that a ternary expression is useful for a single conditional test. In this case we’re testing if the name is set to ‘Jack’, but we can’t check if it’s ‘Karen,’ ‘Sam,’ or ‘Eve.”