if/else
if
-else
分支结构与其他语言类似。不同之处在于,布尔条件不需要用括号括起来,每个条件后面都跟着一个代码块。if
-else
条件是表达式,所有分支必须返回相同的类型。
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
if
-else
分支结构与其他语言类似。不同之处在于,布尔条件不需要用括号括起来,每个条件后面都跟着一个代码块。if
-else
条件是表达式,所有分支必须返回相同的类型。