Not at all sure why you mention being able to do 'multiple operations' - using a comma in this way can be done anywhere and does not relate to the ternary operator at all
Hello Jon,
Yes, for sure, you can do it anywhere! In this article, I'm sharing how to use it with a ternary operation, what you can do with it.
I wanted to show, mainly for newcomers in JavaScript, that you can do multiple operations using this method.
condition ? console.log("Yes") : console.log("No")
I can imagine some people are trying like below, for example, but it's not working.
condition ? console.log("Yes"); console.log("Yes2") : console.log("No")
It was more like additional information. I hope it answered your question! 😊
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Not at all sure why you mention being able to do 'multiple operations' - using a comma in this way can be done anywhere and does not relate to the ternary operator at all
Hello Jon,
Yes, for sure, you can do it anywhere!
In this article, I'm sharing how to use it with a ternary operation, what you can do with it.
I wanted to show, mainly for newcomers in JavaScript, that you can do multiple operations using this method.
I can imagine some people are trying like below, for example, but it's not working.
It was more like additional information.
I hope it answered your question! 😊