Proposal: Static Typing

guest271314 guest271314 at gmail.com
Fri Apr 5 18:35:53 UTC 2019


Two possible solutions to the requirement of not being able to change a
"type" both include utilizing `const`.

1. Using `Object.freeze()`

`const x = Object.freez([1,2,3])`

2. Using `Promise.resolve()`

`const x = Promise.resolve([1,2,3])`

neither of which can be deleted or changed within the current scope.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190405/b8d4de9e/attachment.html>


More information about the es-discuss mailing list