ES5 => 筛选功能  Array.prototypefilter():
代码:
var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const result = words.filter(word => word.length > 6);

console.log(result);
// expected output: Array ["exuberant", "destruction", "present"]
 
ES5 => 数组的处理 Array.prototype.map()
代码:
var array1 = [1, 4, 9, 16];

// pass a function to map
const map1 = array1.map(x => x * 2); console.log(map1);
// expected output: Array [2, 8, 18, 32]
 
 
 
 
 
 
 
 
 

最新文章

  1. 从零开始山寨Caffe·壹:仰望星空与脚踏实地
  2. virtual方法和abstract方法
  3. debian7.1 sources.list
  4. Java for LeetCode 166 Fraction to Recurring Decimal
  5. hdu----(1847)Good Luck in CET-4 Everybody!(简单巴什博奕)
  6. 获取其它进程窗口中的状态栏信息(FindWindowEx GetWindowThreadProcessId OpenProcess SendMessage轮番轰炸)
  7. img超出div width时, jQuery动态改变图片显示大小
  8. zoj 1539 Lot
  9. Android替换APP字体 — Typeface
  10. 《算法导论》Chapter 4 Divide-and-Conquer的学习笔记
  11. C++ 中的sort()排序函数用法
  12. Java基于opencv—归一化
  13. The component and implementation of a basic gradient descent in python
  14. centos 7.5安装docker-CE 18
  15. FFmpeg使用基础
  16. 转换类型 totypeString
  17. 牛客网-湘潭大学校赛重现H题 (线段树 染色问题)
  18. np.tile 函数使用
  19. 洛谷P2777 [AHOI2016初中组]自行车比赛
  20. java 多线程之:join() 方法

热门文章

  1. E - Evaluate Matrix Sum
  2. Android-Java-synchronized静态方法&字节码文件对象
  3. 停止一个java的线程执行
  4. 缓存中使用的ReentrantReadWriteLock锁
  5. HSmartWindowControl 之 摄像头实时显示( 使用 WPF )
  6. 用Socket来简单实现IIS服务器
  7. 关于各种算法以及好的blog的整理(持续更新)
  8. SVM的基础原理
  9. Git-遇到的问题以及解决方法
  10. GoLang学习之数据类型