I don't know why it's this result, why it's not executed sequentially.

    var a = {name: 111};
    console.log(a);
    a.age = 28;


clipboard.png

Jun.30,2021

this is handled by the browser
console.log (a); there is a I prompt next to the expansion, which means that the content displayed has been modified

.
var a = {name: 111};
console.log(JSON.stringify(a));
a.age = 28;
console.log(JSON.stringify(a));

this is the mechanism of the browser.
console.log () you can see that there is only one value name, when you do not click on the object, but when you click on the Object, the browser always outputs the latest value of (see figure below):

.

clipboard.png

you will find that the logo shown in the figure appears next to the folded Object (this value has just been modified).


console.log is executed asynchronously

Menu