Typescript variables: Difference between revisions
From wikinotes
Line 2: | Line 2: | ||
<blockquote> | <blockquote> | ||
<syntaxhighlight lang="typescript"> | <syntaxhighlight lang="typescript"> | ||
let name: string = "alex"; | let name: string = "alex"; // type annotation | ||
let name = "alex"; // inferred type 'string' | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Assignment --> | </blockquote><!-- Assignment --> |
Revision as of 03:08, 11 December 2022
Assignment
let name: string = "alex"; // type annotation let name = "alex"; // inferred type 'string'