-1

It's quite hard to find this answers on Google because this characters are used for other purposes.

This is a example in React:

return (
   <div>
   {sec == 0 ? ( // This one
      ""
   ) : ( // And this one
      <div></div>
   )}
   </div>
)

Thanks

EPurpl3
  • 682
  • 7
  • 25
  • 2
    This is the ternary operator that part of javascript specification (not React). – Alexandre Nicolas Jul 22 '22 at 12:51
  • 2
    The term you need to search for is "ternary operator", [MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) – DBS Jul 22 '22 at 12:51
  • 2
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator – MoRe Jul 22 '22 at 12:51

1 Answers1

0

You can see the explanation in these docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator

Yozez
  • 133
  • 7
  • 2
    This is a link only answer and has already been covered in the comments. To be considered an answer you should put the essential information in your answer and add the link for further reference. Otherwise it should be a comment! – phuzi Jul 22 '22 at 12:54