摘要: function once(fn){ let down = false; return function(){ if(!down){ down = true; return fn.apply(this,arguments); } } } let pay = once(function(money){ 阅读全文
posted @ 2021-09-17 15:51 LaLaLa_heng 阅读(93) 评论(0) 推荐(0) 编辑
摘要: function add(...values) { let sum = 0; for (var val of values) { sum += val; } return sum; } add(2, 5, 3) // 10 阅读全文
posted @ 2021-03-29 16:43 LaLaLa_heng 阅读(37) 评论(0) 推荐(0) 编辑
摘要: let arr = [1,2,3,4,5,6,7]; for (let [index, leaflet] of arr.entries()){ console.log(index,leaflet) } 阅读全文
posted @ 2021-02-04 11:55 LaLaLa_heng 阅读(728) 评论(0) 推荐(0) 编辑
摘要: let arr = [ { createTime: "2020-10-16", imgPath:"http://1.jpg" },{ createTime: "2020-10-16", imgPath:"2.jpg" },{ createTime: "2020-10-17", imgPath:"3. 阅读全文
posted @ 2020-10-23 17:53 LaLaLa_heng 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Array.from([1, , 2, , 3], (n) => n || 0) // [1, 0, 2, 0, 3] function typesOf () { return Array.from(arguments, value => typeof value) } typesOf(null, 阅读全文
posted @ 2020-07-09 11:00 LaLaLa_heng 阅读(133) 评论(0) 推荐(0) 编辑
摘要: returnIndex(str,cha,num){ var x=str.indexOf(cha); for(var i=0;i<num;i++){ x=str.indexOf(cha,x+1); } return x; }, 阅读全文
posted @ 2020-07-03 10:43 LaLaLa_heng 阅读(603) 评论(0) 推荐(0) 编辑
摘要: 使用 Object.create 方法 对象也可以用 Object.create() 方法创建。该方法非常有用,因为它允许你为创建的对象选择一个原型对象,而不用定义构造函数。 // Animal properties and method encapsulation var Animal = { t 阅读全文
posted @ 2020-05-26 10:12 LaLaLa_heng 阅读(132) 评论(0) 推荐(0) 编辑
摘要: getAuthCode(){ if (!this.disabledBtn) { this.disabledBtn = true; let n = 3; let time = setInterval(()=> { var str = '(' + n + ')' + '重新获取'; this.authC 阅读全文
posted @ 2020-05-22 20:08 LaLaLa_heng 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Form 表单的手机、税号验证 ruleValidate: { salesmanPhone: [ { required: true, message: '手机号不能为空!', trigger: 'blur' }, { type: 'string', pattern: /^1[3456789]\d{9 阅读全文
posted @ 2020-04-16 10:40 LaLaLa_heng 阅读(1599) 评论(0) 推荐(0) 编辑
摘要: 摘自 https://www.jianshu.com/p/58fec8dcb436 阅读全文
posted @ 2020-04-15 14:46 LaLaLa_heng 阅读(365) 评论(0) 推荐(0) 编辑