所有语句都可以在``列表''中执行的内容,例如[if(true),for(;;)]``
我知道, loops, if(true)条件和三元运算符((true)?1:2
) ,但
我很好奇,所有语句都可以在list
initialization [] 中执行,例如[if(true),for(;;) ]
,
感谢您...
I know of, for(;;)
loops, if(true)
conditions, and ternary operators ((true)?1:2
), but
I'm curious, that what all statements can be executed inside the List
initialization []
, like [ if(true), for(;;) ]
,
Thanking you...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
特别感谢您通过评论提供的回答,并谦虚地@jamesdlin。
所有表达式都得到支持,例如:
for(;;)
if(true)
(true)?1:2
... ['1','2','3']
(x + y)
等
来源
Special thanks to the ever helping and humble @jamesdlin for this answer via comment.
All the expressions are supported, like:
for(;;)
if(true)
(true)?1:2
...['1', '2', '3']
(x + y)
function(argument)
etc.
source