0

Can anyone explain to me what does "?" mean in the code below? It is ReactJS.

<p className="showmore" className={showMore ? 'show' : 'hide' }>{item.description}

Thanks!

wrzeciono
  • 29
  • 5
  • 1
    It's a [Conditional (ternary) Operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) – palaѕн Dec 25 '17 at 15:18
  • Rephrase as "What is a ternary operator in JavaScript?" "The conditional (ternary) operator is the only JavaScript operator that takes three operands. This operator is frequently used as a shortcut for the if statement." https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator – Mark Schultheiss Dec 25 '17 at 15:21

0 Answers0