javascript
versious
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
td合并在PC或安卓浏览器里出现问题,ios正常
td合并ios正常,其他浏览器样式错乱原创 2021-12-09 14:54:47 · 186 阅读 · 0 评论 -
箭头函数使用
一般写为: x => x * x 相当于: function (x) { return x * x; } 如果多个参数,则要在X外面加() (x,y) => x * y 如果返回的值是对象,需要改为 x => ({ foo: x }) 如果包含多条语句,需要加上{…}和return x => { if (x > 0) { return x * x; } else { return - x * x; } } ...原创 2021-11-12 15:03:23 · 320 阅读 · 0 评论 -
js 10位数时间戳
const timeStr = Math.round(new Date(date).getTime() / 1000).toString(); 百度到的原创 2021-08-08 15:40:39 · 964 阅读 · 0 评论 -
记一次同样的日期时间戳对比踩坑
const nowStr = new Date('2021-06-29').getTime(); const endStr = new Date('2021/06/29').getTime(); 这2个得出来的时间戳不是一样的啊啊啊啊啊啊啊,都改成了2021/06/29这种格式原创 2021-06-29 22:36:59 · 457 阅读 · 0 评论 -
forEach map无法退出循环。使用for of
在递归函数里面使用了forEach,forEach中使用了return,怎么return也return不出去,开始以为菜鸡如我写的递归有问题,然后百度查了之后发现forEach无法退出当前循环,今天遇到了map也是一样无法退出循环的。 但是又不想写原生的for let i=0...,找到了es6的for of,不用自己定义let i=0;i<list.length;i++,也能跳出循环啦 for (const configItem of configuration) { if .原创 2021-04-09 16:19:19 · 666 阅读 · 0 评论
分享