objective-c - swift中的map()方法
天蓬老师
天蓬老师 2017-05-02 09:19:57
0
1
352

为什么执行次数是5times而不是4times

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
Ty80

What debugging tool are you using? I changed the map’s closure:

var arr = [1,2,3,4]
let mapArr = arr.map({
  (i: Int) -> Int in
    print("a")
    return i * 2
})

Only 4 'a's are output.
My platform is: Swift on Ubuntu.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!