What is the difference between extending a subclass of an object and `Object.create`-ing based on a prototype for the purposes of JS private fields? I'm surprised to get different behavior between:
```javascript
class Foo {
#foo = 'foo';
doSomething(): void {
console.log(this.#foo);
}
}
class Bar extends Foo {}
new Foo().doSomething(); // Works
new Bar().doSomething(); // Works
Object.create(new Foo()).doSomething(); // ERROR: Cannot read private member.
```
In my mind, they should create basically the same prototype inheritance. Why does `Object.create` fail?
https://www.typescriptlang.org/play/?target=99#code/MYGwhgzhAEBiD29oG8BQ1oGIBmjoF5oByXeIgblXWgBN4BleAWwFMAXACwEsA7AcwAUASgBc0AG7wuNFNQzB4PCPBAsAdCHiDOXCGpyIhlDAF9UZ1KEgwAQmABO0FgA82LHjRgIkyCzxYA7nCIwmp0jKw6-MLk0AD0cdAA6vD2ANYQqP5Bdvah4czs3NFG8Ykp6ZkA8gBGAFYswGxqwPYsYG4C2cHwwkJhDIVRgqUJ0ACiAEqTVZNiAMJgPDzwbNBtYDIADvZc4h0s0KxMNSz2akA
#JavaScript #PrivateFields