(゜-゜)つロ ganto.me

11 2023 档案

摘要:事例代码 var o = (function() { var obj = { a: 1, b: 2, } return { get: function(k) { return obj[k] } } })() 说明 如上一段代码,在不改变原代码的情况下,修改obj对象中的a、b属性。 分析 代码使用了 阅读全文
posted @ 2023-11-17 07:41 干徒 阅读(88) 评论(0) 推荐(0) 编辑
摘要:创建Star类 class Star { constructor(will, score, dom) { this.will = will; this.score = score; this.dom = dom; } init() { const that = this; this.dom.forE 阅读全文
posted @ 2023-11-17 02:07 干徒 阅读(10) 评论(0) 推荐(0) 编辑
摘要:柯里化就是将多参函数变成单参函数 // 实现函数柯里化 function currying() { } // 测试柯里化函数 const sum = (a, b, c, d) => a + b + c + d; console.log(currying(sum)(1)(2)(3)(4)); // 1 阅读全文
posted @ 2023-11-17 01:26 干徒 阅读(6) 评论(0) 推荐(0) 编辑

⬆️ ⬇️
点击右上角即可分享
微信分享提示