|
|
|
|
|
by conical
3930 days ago
|
|
Const is a pretty good example, the closest I can think to emulating it in es5 is something like: Object.defineProperty(this, 'five', {
enumerable: true,
writable: false,
value: 5,
configurable: false
}); If in global scope, 'five' will look like a const. WeakMap and WeakSet have polyfills with minor caveats. I guess you're defining language features as not "syntactic sugar" if they can't be absolutely 100% polyfilled. |
|