Skip to content

Commit

Permalink
docs(Readme): update version to v0.1.1-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzz19951230 committed Aug 14, 2021
1 parent e8a39ab commit b1a9ae8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ jsIntArray.forEach(object : UnTypedIteratorCallback<Unit>{
println("jsIntArray[$index] = $currentValue")
}
})
// 3、使用lambda函数
jsIntArray.forEach { index, value->
println("jsIntArray[$index] = $value")
}

// 其他迭代相关的函数,如map()、filter()、every()等以此类推。又比如,reduce()、reduceRight()的基本使用如下(简单的数值累加的例子):
jsIntArray.reduce(object : TypedIteratorCallback<Int?, Int>{
override fun call(currentValue: Int?, index: Int, total: Int?, arr: Any?): Int {
Expand Down

0 comments on commit b1a9ae8

Please sign in to comment.