Skip to content

Commit

Permalink
Fix array.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
krahets committed Nov 14, 2023
1 parent 9e26464 commit 784b12e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codes/dart/chapter_array_and_linkedlist/array.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ void traverse(List nums) {
count += nums[i];
}
// 直接遍历数组元素
for (var num in nums) {
count += num;
for (var x in nums) {
count += x;
}
// 通过 forEach 方法遍历数组
nums.forEach((element) {
Expand Down

0 comments on commit 784b12e

Please sign in to comment.