Array.apply(null, {length: 5}) length为特殊字段,意思是生成一个长度为5的数组,由于没赋值,所以都是undefined;

 如果要赋值,可以这样
console.log(Array.apply(null, {0:'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', length:5})); //["a", "b", "c", "d", "e"]
和ES6的Array.from有点类似, Array.from

最新文章

  1. 【Redis】:Jedis 使用
  2. Linux Pthread 深入解析(转-度娘818)
  3. How do I list the files in a directory?
  4. 模块加载(require)及定义(define)时的路径
  5. HC-05初探
  6. Spring使用——切面编程AOP使用
  7. TP-Link访问策略
  8. BZOJ 2956 模积和
  9. 解决Scala异常处理java.lang.OutOfMemoryError: Java heap space error
  10. 数据库 mysql 优化器原理
  11. win7下简单FTP服务器搭建
  12. order by跟group by 跟having----------------sum() 求和   avg()求平均   count() 求个数--------------like
  13. 初学socket,c语言写的简单局域网聊天
  14. UESTC_秋实大哥与线段树 2015 UESTC Training for Data Structures<Problem M>
  15. TestNg框架基础入门
  16. intellij idea 破解教程
  17. java的反射机制浅谈(转)
  18. 基于git 客户端使用shell工具
  19. PAT甲1004 Counting Leaves【dfs】
  20. jquery选择器总结2

热门文章

  1. [BZOJ1005]Prufer数列+排列组合
  2. hdu 2112 HDU Today (最短路)
  3. 如何在本机搭建SVN服务器【转】
  4. float和double类型的存储方式
  5. 【洛谷P3708】Koishi的数学题
  6. unbuntu下mount windows共享目录
  7. Bringing up interface eth0: Determining if ip address 10.109.67.81 is already in use for device eth0...
  8. redis发布订阅、HyperLogLog与GEO功能的介绍
  9. magento 调整产品详细页自定义选项或配置项的位置
  10. Rescue The Princess