Write a simple example
Let’s write a Hello World program. In src
, create the file main.ts
:
1 2 3 4 | function hello(compiler: string) { console.log(`Hello from ${compiler}`); } hello( "TypeScript" ); |
In the project root, proj
, create the file tsconfig.json
:
1 2 3 4 5 6 7 8 9 | { "files" : [ "src/main.ts" ], "compilerOptions" : { "noImplicitAny" : true , "target" : "es5" } } |
Please login to continue.