模块化
ESM/CommonJs/AMD/UMD
js
sort
默认没有函数 按照 UTF-16 排序,对于字母数字按 ASCII 排序

防抖&节流
call、apply & bind
http & 网络
从输入URL到页面加载发生了什么?
异步
代码输出
async function async1() {
console.log('async1 start')
await async2()
console.log('async1 end')
}
async function async2() {
console.log('async2')
}
console.log('script start')
setTimeout(function () {
console.log('settimeout')
})
async1()
new Promise(function (resolve) {
console.log('promise1')
resolve()
}).then(function () {
console.log('promise2')
})
console.log('script end')
作用域问题
var a = 10
(function () {
console.log(a)
a = 5
console.log(window.a)
var a = 20
console.log(a)
})()
改写后::
var a = 10
(function () {
var a
console.log(a)
a = 5
console.log(window.a)
a = 20
console.log(a)
})()

2
var a = {n:1};
a.x = a ={n:2};
console.log(a.x);
阅读文章
https://muyiy.cn/question/js/41.html