mylist.filter( ~~~ ).foreach( myItem => ~~ )
如果没有通过“过滤器”匹配的数据,是否不执行foreach方法?
它被执行,它只接收一个空列表( filter
的结果)作为输入,因此什么也不做。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.