mirror of
https://github.com/hi-language/hi-language.github.io.git
synced 2026-01-13 16:18:04 +00:00
Feat: Add standalone if-statement example
This commit is contained in:
@@ -208,9 +208,10 @@ grade: (score >= 90) ? { "A" }
|
||||
: { "D" }
|
||||
_(grade) // Prints "C"
|
||||
|
||||
// Use for side-effects, like a traditional 'if'.
|
||||
// The return value is discarded.
|
||||
(grade == "C") ? { _("Passable") }
|
||||
// Use as a standalone 'if' for side-effects.
|
||||
// The block executes if the condition is true; the return value is discarded.
|
||||
isReady: !0
|
||||
(isReady) ? { _("System is ready.") }
|
||||
\`\`\`
|
||||
|
||||
## Data Structures
|
||||
|
||||
Reference in New Issue
Block a user