console.write(post.author === 'joelnet' ? 'You are correct' : 'BZZZZZT!')
>You are correct
I could see the verbiage "a ternary operator" if you're trying to get across that you're not limited to one per statement / function / module / etc., but until they define another one, ? is the ternary operator.
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
It does seem that you really only need one, as others could be expressed in terms of the first. I actually gave this probably more thought than I should have, but the only things I could come up with were not conditional operators; they were more combinations of prefix/postfix/infix operators.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
console.write(post.author === 'joelnet' ? 'You are correct' : 'BZZZZZT!')
>You are correct
I could see the verbiage "a ternary operator" if you're trying to get across that you're not limited to one per statement / function / module / etc., but until they define another one,
?
is the ternary operator.Now I am curious about what a second ternary operator would do...
It does seem that you really only need one, as others could be expressed in terms of the first. I actually gave this probably more thought than I should have, but the only things I could come up with were not conditional operators; they were more combinations of prefix/postfix/infix operators.