Results 9 comments of Beyound

```js function LazyMan(name) { return new function () { this.name = name console.log(`Hi I am ${this.name}`) this.events = [] this.firstEvents = [] this.eat = function (el) { this.events.push(() => console.log(`I...

> 为什么 `forEach` 的性能那么差,为什么还要有这个方法呢?难道就是为了方便? forEach是声明式函数,我们不用关心内部如何去实现的;for循环是命令式函数,我们告诉计算器如何去做

请你说下响应式和双向绑定的关系

```js (function (done) { if (!done) return; // 如何实现一个深拷贝 (cloneDeep) const obj = { re: /hello/, f() {}, date: new Date(), map: new Map(), set: new Set(), list: [1, 2,...

```js // 这是一道字节跳动的面试题目,见面经 某银行前端一年半经验进字节面经。山月认为这也是一道水平较高的题目,promise 串行,并行,二分,并发控制,层层递进。 // 请实现以下 sum 函数,只能调用 add 进行实现 /* 请实现一个 sum 函数,接收一个数组 arr 进行累加,并且只能使用add异步方法 add 函数已实现,模拟异步请求后端返回一个相加后的值 */ function add(a, b) { return new Promise((resolve) => { setTimeout(()...

```js let person1 = { name: "Tom", sayHi(to,...args) { console.log(`Hi,${to}, my name is ${this.name}。${args && args.toString()}`); }, }; person1.sayHi(); let person2 = { name: "Jerry", }; // call person1.sayHi.call(person2, "Heydi");...

Excuse me, ask, has it been realized