Post
Share your knowledge.
farshad37
Dec 01, 2024
Expert Q&A
Is there a ternary operator in the Move programming language?
Is there a ternary operator in the Move programming language?
- Move
- Move Bug
2
2
Share
Comments
Answers
2Dec 1 2024, 23:54
There isn't a ternary operator, but the match
expression might be a good alternative. An example is provided using the match
operator to select based on boolean conditions.
1
Best Answer
Comments
Dec 2 2024, 05:48
I suggest using an if
expression similar to ternary operation, such as let variable = if (something_is_true) 10 else 15;
.
1
Comments
Do you know the answer?
Please log in and share it.
Move is an executable bytecode language used to implement custom transactions and smart contracts.
32Posts54Answers
Trending posts