Skip to content

Commit

Permalink
feat(docs): update docs
Browse files Browse the repository at this point in the history
Updates the Wing docs. See details in [workflow run].

[Workflow Run]: https://github.com/winglang/docsite/actions/runs/10219003919

------

*Automatically created via the "update-docs" workflow*

Signed-off-by: monabot <[email protected]>
  • Loading branch information
monadabot committed Aug 2, 2024
1 parent bcdef8a commit 10b2d2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ for value in 1..=5 {
}
```

### If elif else
### If / else if / else

```ts playground example
let grade = (score: num): str => {
// Parentheses are optional in conditions.
// However, curly braces are required in `if/else` statements.
if 0 < score && score < 55 {
return "F";
} elif 55 <= score && score < 65 {
} else if 55 <= score && score < 65 {
return "C";
} elif 65 <= score && score < 75 {
} else if 65 <= score && score < 75 {
return "B";
} elif 75 <= score && score <= 100 {
} else if 75 <= score && score <= 100 {
return "A";
} else {
return "Invalid grade";
Expand Down
6 changes: 3 additions & 3 deletions api_versioned_docs/version-latest/05-language-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1284,16 +1284,16 @@ includes for and while loops currently.
### 2.5 if
Flow control can be done with `if/elif/else` statements.
The **if** statement is optionally followed by **elif** and **else**.
Flow control can be done with `if/else if/else` statements.
The **if** statement is optionally followed by **else if** and **else**.
> ```TS
> // Wing program:
> let x = 1;
> let y = "sample";
> if x == 2 {
> log("x is 2");
> } elif y != "sample" {
> } else if y != "sample" {
> log("y is not sample");
> } else {
> log("x is 1 and y is sample");
Expand Down

0 comments on commit 10b2d2f

Please sign in to comment.