What is the strange problem with prototype using a constructor of Object.defineProperty?

one day when I was reading defineProperty on MDN, there was a paragraph I didn"t understand, so I ran a piece of code like this on the browser to debug

var Foo = function(){};

Object.defineProperty(Foo.prototype,"x",{
    get(){
        return 3;
    }
});

var foo = new Foo();

console.dir(foo);

the result I expect should be

Foo{
    __proto__:{
        constructor:  (),
        x: 3,
        __proto__: Object
    }
}

but the real result is

Foo{
    x: 3,
    __proto__:{
        constructor:  (),
        x: 3,
        __proto__: Object
    }
}

Why does the x attribute already appear on the outermost layer? Ask the great god and the teacher to explain

Feb.20,2022

Google tried to get the same result as yours, and then tested

console.dir(foo.hasOwnProperty('x'));

returns false, probably guessing that it is probably a problem in the form of console output. Using Firefox, the result is as follows

clipboard.png

foo.y = 3;

clipboard.png

y x ;

: ;
:

clipboard.png

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-1b31be9-2bda2.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-1b31be9-2bda2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?