The scenario is the following: I want to return the value of a when a is defined and else I want to return b. I need an expression because of JSX.
I am looking for a better way to write the expression a ? a : b
where a and b are variables. I was trying !a&&b
. The problem is when a is defined, then it returns of course false
instead of the value of a which I want to receive then. I think I have my wires crossed at the moment. If someone has an idea, I would highly appreciated it.