Made Else if statements and ternary operator in JS