I want to set v = false if condition true or otherwise v = nil. I use this code:
or
The result always nil. Do you know why it's not work? How could I fix it. I want to write in shortway so I dont want to use if conditon.
Well I ask google gemini and get the answer. thanks.
Code:
value = 4>3 and false or nil
or
Code:
value = 3<4 and false or nil
The result always nil. Do you know why it's not work? How could I fix it. I want to write in shortway so I dont want to use if conditon.
Well I ask google gemini and get the answer. thanks.