JS
JS
感觉就是this的指向问题,只有在调用的时候才会确定this的指向,谁调用方法this就是谁的
``` let obj = {1:222, 2:123, 5:888}; let arr=Array.from({length:12}).fill(undefined); for(let [key,value] of Object.entries(obj)){ arr[key-1] = value; } ```
``` !function(num){ let span=''; while(Math.floor(num)>=1){ const temp = num%10; num/=10; span+=temp|0; } console.log(span)//4321 }(num=1234) ```
``` var arr= [2, 10, 3, 4, 5, 11, 10, 11, 20]; let tempArr=[...new Set(arr)].sort((a,b)=>{ return a-b; })//[ 2, 3, 4, 5, 10, 10, 11, 11, 20 ] let map...
when I use teleport whose to is shadow root, there is also a relatively long time until the click handler will be registered (about 5 seconds)