Coming here shows that you are smart and diligent. You must be learning the super cluster typescript of JavaScript. Fortunately, you have worked hard to write the code: the running results are as follows
- error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
It generally means that you need to compile to version Es5 or above
that is, you need to specify that you need to compile to version Es5 or above
then you can specify this:
tsc project_name.ts -t es5 // example: tsc class.ts -t es5
Run successfully, continue to write the set/get method happily
Similar Posts:
- ERROR StatusLogger No log4j2 configuration file found. Using default configuration
- Thread.currentThread().getContextClassLoader()Class.getClassLoader()
- [Two Solutions] Syntax error: unexpected token import
- Solve the problem of link: fatal error LNK1104: unable to open the file “d3dx9. Lib”
- [Solved] Lexical declaration cannot appear in a single-statement context
- The solution of “unsupported major. Minor version 52” in Java project compilation
- Idea write JUnit test case found:…empty test suite
- Android Call requires API level 11 [How to Solve]
- How to Solve Annotation type expected error
- How to Solve JAVA @override error