摘要: 释: setTimeout是一次执行函数,这里是1秒后执行,仅仅执行一次;for(var i=0;i<10;i++),i的每次取值都是执行setTimeout这个函数,并没有执行setTimeout里面的function(即闭包函数),setTimeout里面的function是有setTimeou 阅读全文
posted @ 2017-10-11 16:46 thelongmarch 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 下面总结一下js中时间戳与日期格式的相互转换: 1. 将时间戳转换成日期格式: 1 2 3 4 5 6 7 8 9 10 11 12 function timestampToTime(timestamp) { var date = new Date(timestamp * 1000);//时间戳为1 阅读全文
posted @ 2017-10-11 10:47 thelongmarch 阅读(129) 评论(0) 推荐(0) 编辑