Move.

帖子

分享您的知识。

farshad.
Dec 01, 2024
专家问答

Move 编程语言中有三元运算符吗?

Move 编程语言中有三元运算符吗?

  • Move
  • Move Bug
2
2
分享
评论
.

答案

2
Theoremus.
Dec 1 2024, 23:54

没有三元运算符,但该match表达式可能是一个不错的选择. 提供了一个使用match运算符根据布尔条件进行选择的示例.

1
最佳答案
评论
.
Pluto Dev👽.
Dec 2 2024, 05:48

if我建议使用let variable = if (something_is_true) 10 else 15;类似于三元运算的表达式,例如.

1
评论
.

你知道答案吗?

请登录并分享。

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148帖子231答案
Sui.X.Peera.

赚取你的 1000 Sui 份额

获取声誉积分,并因帮助 Sui 社区成长而获得奖励。

奖励活动七月