摘要:
比较和逻辑运算符用于测试 true 或 false。 比较运算符 比较运算符在逻辑语句中使用,以判定变量或值是否相等。我们给定 x = 5,下表中解释了比较运算符: 运算符描述比较返回 == 等于 x == 8 false x == 5 true x == "5" true 值相等并且类型相等 x 阅读全文
posted @ 2020-12-07 15:00
酷儿q
阅读(111)
评论(0)
推荐(0)
摘要:
1、filter() 方法创建一个新的数组,新数组中的元素是通过检查指定数组中符合条件的所有元素。 原数组不变不会对空数组进行检测 let arr1 = [1,2,3,4] let arr2 = arr1.filter(item=>item 1) console.log(arr1, 'arr1') 阅读全文
posted @ 2020-12-07 14:59
酷儿q
阅读(4555)
评论(0)
推荐(0)
摘要:
Math.random() 返回 0(包括) 至 1(不包括) 之间的随机数: 实例 Math.random(); // 返回随机数 JavaScript 随机整数 Math.random() 与 Math.floor() 一起使用用于返回随机整数。 实例 Math.floor(Math.rando 阅读全文
posted @ 2020-12-07 14:58
酷儿q
阅读(270)
评论(0)
推荐(0)
摘要:
1、js中使用new Date()来获取当前设备的时间,修改当前设备的时间 var now = new Date(); now; // Thu Nov 07 2019 16:08:51 GMT+0800 (中国标准时间) now.getFullYear(); // 2015, 年份 now.getM 阅读全文
posted @ 2020-12-07 14:57
酷儿q
阅读(276)
评论(0)
推荐(0)
摘要:
需求: 前端js,已知开始时间a、结束时间b和间隔天数c,要求取在a-b这两个时间范围内、间隔c天的所有日期。 代码: // startDate: 计划开始时间; endDate:计划结束时间;dayLength:每隔几天,0-代表每天,1-代表日期间隔一天 function getDateStr( 阅读全文
posted @ 2020-12-07 14:56
酷儿q
阅读(1883)
评论(0)
推荐(0)
摘要:
一、原生css.supports语法 返回布尔值 true 或者 false ,用来检测是否支持某css属性。 语法 CSS.supports(propertyName, value); CSS.supports(supportCondition); 参数 propertyName字符串。用来检测的 阅读全文
posted @ 2020-12-07 14:55
酷儿q
阅读(1146)
评论(0)
推荐(0)
摘要:
!function(n){ var e=n.document, t=e.documentElement, i=720, d=i/100, o="orientationchange"in n?"orientationchange":"resize", a=function(){ var n=t.cli 阅读全文
posted @ 2020-12-07 14:54
酷儿q
阅读(83)
评论(0)
推荐(0)

浙公网安备 33010602011771号