Created
November 12, 2021 00:25
-
-
Save szaranger/ffaa73353895a912c19b72df1b662ea2 to your computer and use it in GitHub Desktop.
blog-typescript-features-you-should-no-longer-use-82ede931243-01.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Freeze | |
| class Person {} | |
| function Freeze(constructor: Function) { | |
| Object.freeze(constructor); | |
| Object.freeze(constructor.prototype); | |
| } | |
| console.log(Object.isFrozen(Person)); // true | |
| class Cat extends Person {} // error, cannot be extended |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment