Skip to content

Commit 8711d86

Browse files
Change prev variable name to next
This is in line with the other examples and technically correct: the value in the second variable is the next element that will be processed by the reduce function.
1 parent fbcd867 commit 8711d86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/azure-resource-manager/bicep/bicep-functions-lambda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ var dogs = [
213213
}
214214
]
215215
var ages = map(dogs, dog => dog.age)
216-
output totalAge int = reduce(ages, 0, (cur, prev) => cur + prev)
217-
output totalAgeAdd1 int = reduce(ages, 1, (cur, prev) => cur + prev)
216+
output totalAge int = reduce(ages, 0, (cur, next) => cur + next)
217+
output totalAgeAdd1 int = reduce(ages, 1, (cur, next) => cur + next)
218218
```
219219

220220
The output from the preceding example is:

0 commit comments

Comments
 (0)