mutationObserver 可以监听节点为的变化

    1. const oTarget = document.getElementById('app');
    2. function cb (mutationList, observer) {
    3. console.log(mutationList, observer);
    4. }
    5. const observer = new MutationObserver(cb);
    6. observer.observe(oTarget, {
    7. attrributes: true,
    8. childList: true,
    9. subtree: true
    10. });

    process.nextTick 是 nodeJS 的方法

    Promise.resolve().then(() => {
        console.log('Promise');
    });
    
    setTimeout(() => {
        console.log('setTimeout'), 0)
    });
    
    process.nextTick(() => {
        console.log('nextTick');
    });
    
    // nextTick
    // Promise
    // setTimeout
    

    作为微任务优先于 Promise 的运行