Typescript important
The compiler by default transpiles to ES3. The let keyword doesn't exist in ES3 and so the emitter must emit code using syntax available in ES3... in this case the best replacement for the let keyword is the var keyword.
If you want it to emit with the let keyword, then you must target ES6—"target": "es6" in tsconfig.json or the command line option --target es6. Doing this will output with the same code that you inputted.
tsc B.ts --target es6
https://www.tutorialrepublic.com/
error in typescript
error TS2304: Cannot find name 'Iterable'.
20 export interface ReactNodeArray extends Iterable<ReactNodeLike> {}
tsc -t es6 filename.ts[comile by using this command]
Comments
Post a Comment