Js object reference

the first type

var a = {m: 1};
a.x = a = {c: 2};
console.log(a, a.x)

the result of the above code in chorme: {c: 2}, how do you explain the result of undefined;?

the second type

var a = {m: 1};
a.x = a;
console.log(a)

the above code results in only an infinitely expanded object in chorme;

the above two cases: in the first case, my idea is
1). The operator level is higher than =; so a. X = undefined;, that is, a = {m: 1, x: undefined};
2) = operator from right to left; an is first rewritten as {c br 2}; then a.x = a;
the final result will be the same as the second result? But the result of the first kind is completely different from what I thought! How do you explain this process?
then by the way: for the second case; I see a similar assignment in the source code of vue; this undoubtedly leads to object references; object references don"t sound good; why does such a thing happen again in vue? What are the advantages and disadvantages?
there are no such problems with typing code; now I calm down and think about it and find that I don"t even know js!

Mar.24,2022

can't you see that A.M is gone, too? Because a has been reassigned.
try the following program:

var a = {m:1};
var b = a;
a.x = a = {c:2};
console.log(a, b);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dc45-2c3ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dc45-2c3ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?