- 博客(2)
- 收藏
- 关注
原创 js获取今天昨天明天的日期
/* * @params date 日期 * @params type 日期 prev/current/next 昨天/今天/明天 * @params fmt 日期拼接符*/function getDays(date, type, fmt) { let currentDate = new Date(date) let y = currentDate.getFullYear() let m = currentDate.getMonth() + 1 let d
2021-12-16 15:09:12
799
转载 数组常用的方法函数
1. Array.push() 在原数组末尾追加一个或多个元素,返回该数组的长度1 let arr = [ 1 , 2 , 3 ]2 arr.push( 4 , 5 ) // 返回值为数组的长度 53 console.log(arr) // [1, 2, 3, 4, 5]2. Array.pop() 删除数组的最后一个元素,并返回该元素1 let arr = [ 1 , 2 , 3 , 4 ]2 arr.pop() // 返回值为删除的元素 43 console.log(arr) // [1
2021-12-14 17:14:49
3771
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人