几个关于字体和Electron有趣的面试题

经过这么些面试,对于所做过的字体和 Electron,要么不根据项目来问,直接就是 Vue 原理,要么就是前端八股,最多也就是几个简单的 Electron 使用的问题。...

十月 10, 2024 · 6 分钟 · 2638 字

99%手写的Promise,都没法过的case

今儿个朋友在重构代码的时候,和我吐槽了如下题这么个代码。让判断下调用顺序,真是Promise写出了callback的感觉。 先不看答案,试试能...

六月 29, 2024 · 2 分钟 · 586 字

手写面试题

手写call、apply、bind 区别: call 接收多个参数 apply 接收数组 bind 返回函数,不直接调用。能够分两次接收参数。 原理上就是把function挂在...

六月 8, 2024 · 1 分钟 · 488 字

原型链

原型链是JavaScript中实现继承和对象间属性共享的一种机制。 当谈到继承时,JavaScript 只有一种结构:对象。每个实例对象(obj...

六月 7, 2024 · 3 分钟 · 1008 字

从版号排序到手写Sort

给版本号排序 var versions = ['2.0.1', '1.1.0', '1.0.2', '2.0.0', '1.0.0', '3.0.10', '2.1.10', '2.0.0']; versions.sort((a, b) => { const alist = a.split('.'); const blist = b.split('.'); for (let i = 0; i < alist.length; i ++) { if (alist[i] > blist[i]) { return 1; } else if (alist[i] < blist[i]) { return -1; } else { continue; } } return 0; }) sort是...

六月 3, 2024 · 1 分钟 · 217 字

http相关

三次握手四次挥手 客户端发起请求,携带请求序列号 服务端接收,发送应答,返回请求序列号,携带新的服务序列号 客户端收到应答和对应的请求序列号,发送...

六月 2, 2024 · 5 分钟 · 2006 字

script中的defer和async属性

html.spec.whatwg.org 对属性的描述 The async and defer attributes are boolean attributes that indicate how the script should be evaluated. Classic scripts may specify defer or async, but must not specify either unless the src attribute is present. Module scripts may specify the async attribute, but must not specify the defer attribute. Async 和defer 是用于指示脚本应...

六月 1, 2024 · 3 分钟 · 1236 字