摘要: 阅读全文
posted @ 2020-06-09 21:28 EricBlog 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-09 20:59 EricBlog 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-09 20:44 EricBlog 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-09 20:34 EricBlog 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-09 19:43 EricBlog 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-09 18:37 EricBlog 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-09 18:13 EricBlog 阅读(94) 评论(0) 推荐(0) 编辑
摘要: // const s1 = new Set(); // console.log(s1.size); // 0 长度 // const s2 = new Set(['a', 'b']); // console.log(s2.size); // 2 const s3 = new Set(['a', 'b 阅读全文
posted @ 2020-06-09 17:51 EricBlog 阅读(150) 评论(0) 推荐(0) 编辑
摘要: // let name = `这是一个模板字符串`; // console.log(name); let name = `张三`; let sayHello = `Hello,我的名字叫${name}`; console.log(sayHello); // Hello,我的名字叫张三 let htm 阅读全文
posted @ 2020-06-09 17:30 EricBlog 阅读(386) 评论(0) 推荐(0) 编辑
摘要: var arrayLike = { "0": '1', "1": '2', "length": 2 } // var ary = Array.from(arrayLike, item => { // return item * 2; // }); // 简写 var ary = Array.from 阅读全文
posted @ 2020-06-09 17:00 EricBlog 阅读(303) 评论(0) 推荐(0) 编辑
摘要: // 数组合并 let ary1 = [1, 2, 3]; let ary2 = [4, 5, 6] let ary3 = [...ary1, ...ary2]; console.log(ary3); // [1, 2, 3, 4, 5, 6] // 合并数组的第二种方法 let ary1 = [1 阅读全文
posted @ 2020-06-09 15:59 EricBlog 阅读(163) 评论(0) 推荐(0) 编辑
摘要: <script> const sum = (...args) => { let total = 0; args.forEach(item => total += item); return total; } console.log(sum(10, 20)); // 30 console.log(su 阅读全文
posted @ 2020-06-09 15:29 EricBlog 阅读(159) 评论(0) 推荐(0) 编辑
摘要: // 面试题 var obj = { age: 20, say: () => { console.log(this.age); // this 指向的是 window 所以是 undefined } } obj.say(); // undefined 阅读全文
posted @ 2020-06-09 15:14 EricBlog 阅读(104) 评论(0) 推荐(0) 编辑
摘要: // 数组结构 // let ary = [1, 2, 3]; // let [a, b, c] = ary; // console.log(a); //1 // console.log(b); //2 // console.log(c); //3 let ary = [1, 2, 3]; let  阅读全文
posted @ 2020-06-09 14:39 EricBlog 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-09 14:09 EricBlog 阅读(156) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document< 阅读全文
posted @ 2020-06-09 13:21 EricBlog 阅读(203) 评论(0) 推荐(0) 编辑
摘要: window.onload = function() { // 手机号正则 var regtel = /^1[3|4|5|7|8]\d{9}$/; var regqq = /^[1-9]\d{4,}$/; var regnc = /^[\u4e00-\u9fa5]{2,8}$/; var regme 阅读全文
posted @ 2020-06-09 12:53 EricBlog 阅读(184) 评论(0) 推荐(0) 编辑
摘要: <script> // 预定义类 // 验证座机号码的规则 两种格式 010-12345678 或者 0530-1234567 // var reg = /^[\d]{3,4}[-][\d]{7,8}$/; // var reg = /^\d{3}-\d{8}|\d{4}-\d{7}$/; var  阅读全文
posted @ 2020-06-09 11:15 EricBlog 阅读(1254) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document< 阅读全文
posted @ 2020-06-09 10:43 EricBlog 阅读(216) 评论(0) 推荐(0) 编辑
摘要: <script> // 量字符 用来设定某个模式出现的次数 // var reg = /^a$/; // * 可以出现0次或者很多次 // var reg = /^a*$/; // console.log(reg.test('')); // true // console.log(reg.test( 阅读全文
posted @ 2020-06-09 10:41 EricBlog 阅读(97) 评论(0) 推荐(0) 编辑