0

let height = 40 let isCheck = true let rowHeight = height + (isCheck ? 50 : 20)

why would the answer be 90?

3/19/2020 4:17:57 PM

Amber Mitchell

1 Answer

New Answer

+2

That is ternary Operator or conditional Operator you can say. If the condition provided is true than first part is executed otherwise second Your code is equivalent to : if (isCheck){ rowHeight = height + 50; } else { rowHeight = height + 50; }