function getRandom(start, end, fixed = 0) {
let differ = end - start
let random = Math.random()
return (start + differ * random).toFixed(fixed)
}getRandom(1,5) 1<= num >=5
document.addEventListener("paste", function (event) {
var isChrome = false;
if (event.clipboardData || event.originalEvent) {
//某些chrome版本使用的是event.originalEvent
var clipboardData =
event.clipboardData || event.originalEvent.clipboard...
加号运算符// 可以做到转换格式
let a = '12'
let b = + a + 12;
let c = a - 0 + 12
let d = a + 12;
console.log(b); // 24
console.log(c); // 24
console.log(d); // 1212动态绑定属性// 在with中可以操作对象的每一项
let tom = {
name: "tom",
height: 170,
sex: "男"
}
with(tom){
height++
console.lo...
直接返回时间戳:Date.now();当前时间
let newDate = new Date();
let strData = `${newDate.getFullYear()}-${newDate.getMonth() + 1}-${newDate.getDate()} ${newDate.getHours()}:${newDate.getMinutes()}:${newDate.getSeconds()}`
console.log(strData);VIDEO倍速:playbackRate
1. IE 和 IE Mobile 浏览器WindowsIE 9Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)WindowsIE 10Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)WindowsIE 11Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like GeckoWindows PhoneIE 10M...