摘要: Dr. Donald Sadoway at MIT started his own battery company with the hope of changing the world's energy future. It's a dramatic endorsement for a techn 阅读全文
posted @ 2017-11-15 20:51 younglight 阅读(2328) 评论(0) 推荐(0) 编辑
摘要: 「We will not go quietly into the night! We will not vanish without a fight!」 Good morning. Good morning. 早上好! In less than an hour, aircraft from here 阅读全文
posted @ 2017-11-14 22:48 younglight 阅读(1111) 评论(0) 推荐(0) 编辑
摘要: fear or love the Secret of life Hope walls through the fire and faith leaps over it . Our eyes are not viewers.They are also projectors that running a 阅读全文
posted @ 2017-11-13 23:35 younglight 阅读(2841) 评论(0) 推荐(0) 编辑
摘要: 方法一:slice()方法; 方法二:concat()或slice()加pop(); 阅读全文
posted @ 2017-11-11 17:27 younglight 阅读(4621) 评论(0) 推荐(0) 编辑
摘要: 方法一:concat(),连接两个数组,返回一个新数组 方法二:slice()加push() 方法三:splice()方法; 阅读全文
posted @ 2017-11-11 13:14 younglight 阅读(1281) 评论(0) 推荐(0) 编辑
摘要: 方法一:filter ES5方法 方法二:push方法 方法三:splice方法 方法四:利用数组本身的特性,将数组看作队列,使用push和shift方法来操作; function remove(arr,item){ var newarr=arr.slice(0); for (var i=0;i<n 阅读全文
posted @ 2017-11-11 12:26 younglight 阅读(512) 评论(0) 推荐(0) 编辑
摘要: var a=[1,5,'ff','g','h','sd']; alert(indexof(a,'g')); //3 function indexof(arr,item){ if (Array.prototype.indexOf) //判断Array原型中是否有此方法 ... 阅读全文
posted @ 2017-11-10 22:02 younglight 阅读(993) 评论(0) 推荐(0) 编辑
摘要: 对于javascript的循环取值是每个开发者都遇到过的问题,例如,下面这个例子我们并不能得到想要的结果: 我们是希望点击每一个li标签都显示它自己的索引值,但由于内部函数调用时外部的 i 时,i 已经循环完毕,值为5,所以不能正确输出,更详细的解释在于此时onclick函数时一个闭包函数,每次引用 阅读全文
posted @ 2017-10-28 16:13 younglight 阅读(1087) 评论(0) 推荐(0) 编辑
摘要: 关于数组求和问题的几种办法 1、最普通的for循环 2.函数式编程map-reduce 3 、forEach迭代: 4、eval方法: 阅读全文
posted @ 2017-10-24 17:26 younglight 阅读(31656) 评论(0) 推荐(0) 编辑
摘要: 前端知识图谱: javascript数组: javascriptDOM基本操作: javascript变量: javascript函数基础: javascript语句: javascript数据类型: javascript运算符: javascript正则表达式: window对象: javascr 阅读全文
posted @ 2017-10-21 16:09 younglight 阅读(2523) 评论(0) 推荐(1) 编辑