Immutable.js provides several methods to iterate over an Immutable.Map(). These also apply to the other immutable structures found within the Immutable.js family, such as Set and List. The primary methods are map and forEach, but we will also cover filter and groupBy.

// map()
return todos.map(todo => {
return todo.text
}); // filter()
return todos.filter(todo => {
return todo.completed;
}) // groupBy() --> return new Immtuable Map
return todos.groupBy(todo => {
return todo.completed
})

Notice, only forEach method will actually change its value!

// forEach()
function markAllTodosAsComplete(todos) {
return todos.forEach(todo => {
todo.completed = true
});
}

最新文章

  1. Android调用系统相机功能
  2. git一些常用的操作(转载)
  3. redis使用watch完成秒杀抢购功能(转)
  4. 2.AngularJS MVC
  5. top free综合监控工具
  6. Hive history date mapping
  7. spark mllib k-means算法实现
  8. Brush、Color、String相互转换
  9. PHP Cookie处理函数
  10. ZZTHX-注意点
  11. dedecms自定义函数(二次开发)
  12. win7 64 安装Oracle 11G 、使用PLSQL进行连接 标准实践
  13. hdu 素数环
  14. Android应用程序资源的查找过程分析
  15. 如何更快速加载你的JS页面
  16. leetcode day7
  17. C# 读取PDF多级书签
  18. BurpSuite使用笔记
  19. 磁盘挂载问题:Fdisk最大只能创建2T分区的盘,超过2T使用parted
  20. .Net Standard HttpClient封装Htt请求常用操作整理

热门文章

  1. LoadRuner性能测试之内存分析方法及步骤(Windows)
  2. Microsoft Dynamics CRM 2016 增强版的解决方案(CRM新特性,开发者的福利)
  3. sql server 2008 中的架构(schame)理解
  4. (转)IIS7 下部署Asp.net应用
  5. .NET技术
  6. Java如何获取当前的jar包路径以及如何读取jar包中的资源
  7. 使用QtCreator作为ROS调试器
  8. nginx网站架构优化思路(原)
  9. Android开源库
  10. Qt5.3企业版和开源版功能区别