Write a simple example

Write a simple example

Let’s write a Hello World program. In src, create the file main.ts:

function hello(compiler: string) {
  console.log(`Hello from ${compiler}`);
}
hello("TypeScript");

In the project root, proj, create the file tsconfig.json:

{
  "files": [
    "src/main.ts"
  ],
  "compilerOptions": {
    "noImplicitAny": true,
    "target": "es5"
  }
}
doc_TypeScript
2016-10-04 19:25:46
Comments
Leave a Comment

Please login to continue.