![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js 学习
骙骁
Your are a book, is the only one in the world, Don't take yourself, live into others.
展开
-
日期计算
1.输出今天是今年的第多少天,也可查询到年底还有多少天function getDays(cur, prv) { return (Math.abs((new Date(cur)).getTime() - (new Date(prv)).getTime()) / (60*60*24*1000)).toFixed() // 日期时间戳相减获取差值,除于一天的时间戳,获取正整数}alert(getDays('2021-05-14', '2021-01-01'))alert(getDays('2原创 2021-05-14 13:25:37 · 210 阅读 · 0 评论 -
对象操作备忘
1.对象合并var a = {name: 'Adele', age: 20}var b = {name: 'Chris', age: 20, address: 'beijing'}function update (...args) { return Object.assign(...args)}console.log(update(a, b))2.阶乘f...原创 2017-09-26 15:30:54 · 240 阅读 · 0 评论