- 博客(7)
- 收藏
- 关注
原创 mongodb指令
//show dbs//show collections//insert 插入数据//db.集合名.insert({})//db.集合名.find()//db.集合名.find({age:{KaTeX parse error: Expected 'EOF', got '}' at position 8: lt:"20"}̲})//db.集合名.fin…gt:“20”}})//db.集合名.find({age:{KaTeX parse error: Expected 'EOF', got '}
2020-06-11 11:35:00 111 1
原创 Date对象获取时间
var date1=new Date();var arr = [‘星期日’, ‘星期一’, ‘星期二’, ‘星期三’, ‘星期四’, ‘星期五’, ‘星期六’];console.log(date1);// 年console.log(date1.getFullYear());// 月console.log(date1.getMonth()+1);// 日console.log(date1.getDate());// 星期几console.log(arr[date1.getDay()])/
2020-05-17 18:38:43 169
原创 Math对象
//圆周率console.log(Math.PI)//绝对值console.log(Math.abs(-2))//向下取整console.log(Math.floor(2.9))console.log(Math.floor(-2.9))//向上取整console.log(Math.floor(2.9))console.log(Math.ceil(-2.9))//四舍五入console.log(Math.round(2.4))console.log(Math.round(-2.6))
2020-05-17 17:44:36 194
原创 数组方法
push 头部添加pop 头部删除unshift 尾部添加shift 尾部删除splice 增删改 ,改变原数组slice 复制 ,不改变原数组reverse 翻转数组,改变原数组concat 拼接数组,不改变原数组,返回新数组sort /sɔːrt/ 数组排序 改变原数组reduce 把数组元素进行累加,返回一个累加后的结果(回调函数,累加的初始值)find 查找第一个符合项停止遍历,返回值是查找到的符合条件的元素includes 查找数组中元素是否包含给定的元素,返回true/f
2020-05-17 17:28:48 119
原创 setTimeout Promise
setTimeout(function() { console.log("1") setTimeout(function() { console.log('2') setTimeout(function() { console.log('3') setT...
2020-02-12 22:17:29 97
原创 js数组深拷贝
js 数组深拷贝var ary1=[1,2];1.适用单层数组嵌套的深拷贝var ary2 = ary1.concat();2.适用多层数组嵌套的深拷贝var ary2 = JSON.parse(JSON.stringify(ary1)); 此方法适用于Oject的深度拷贝,因为Array属于Oject类型,所以也适用于此处;需要注意的是:作为Oject的深度拷贝时,要复制的func...
2020-01-08 19:19:12 142
原创 焦点定时式轮播图
焦点定时式轮播图 <script type="text/javascript"> //获取ul var ul=document.getElementsByTagName('ul')[0];...
2019-11-26 10:48:51 145
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人