Typescript install: Difference between revisions

From wikinotes
(Created page with " = Install = <blockquote> <syntaxhighlight lang="bash"> npm install -g typescript </syntaxhighlight> </blockquote><!-- Install -->")
 
No edit summary
Line 4: Line 4:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
npm install -g typescript
npm install -g typescript
</syntaxhighlight>
<syntaxhighlight lang="typescript">
// greet.ts
function greeting(number: number, person: string) {
    return "hello `number`x times, `person`";
}
console.log(greeting(0, "user"));
</syntaxhighlight>
<syntaxhighlight lang="bash">
tsc greet.ts
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Install -->
</blockquote><!-- Install -->

Revision as of 00:05, 17 December 2022

Install

npm install -g typescript
// greet.ts

function greeting(number: number, person: string) {
    return "hello `number`x times, `person`";
}

console.log(greeting(0, "user"));
tsc greet.ts