4 ms·
#private fields are not slow when used natively. It's true the down-levelled code that uses WeakMaps is slower. The decision to downlevel is in the hands of th
by robpalmer 5y ago
#private fields are not slow when used natively.
It's true the down-levelled code that uses WeakMaps is slower. The decision to downlevel is in the hands of the user and is controlled by the tsconfig "target" option.
The only environment that needs downlevelled #private fields is IE11.
- auggierose 5y agoWhich value are you setting for target? I tried es2021, and it still doesn't give me native #. I cannot use esnext, because other stuff doesn't compile anymore.