Skip to content

Commit

Permalink
Docs: Update for-and-while-statement.md (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricosmall committed Dec 29, 2023
1 parent cbb679e commit 7f06e4c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sidebar_label: for 和 while 语句

生成一个包含 1 到 20 的所有数字的数组,并打印每一项。
#### JavaScript 实现
```
```typescript
let numbers = Array.from({ length: 20 }, (_, i) => (i + 1));

for (let el of numbers) {
Expand All @@ -21,7 +21,7 @@ for (let el of numbers) {
```

#### Python 实现
```
```python
numbers = range(1, 21)

for el in numbers:
Expand Down

0 comments on commit 7f06e4c

Please sign in to comment.