当前位置:网站首页>Know typescript
Know typescript
2022-07-24 19:28:00 【Michael999】
TypeScript yes JavaScript A superset of , Support ECMAScript 6 standard .
TypeScript A free and open source programming language developed by Microsoft .
TypeScript The design goal is to develop large-scale applications , It can be compiled into pure JavaScript, compiled JavaScript Can run on any browser .
JavaScript And TypeScript The difference between
TypeScript yes JavaScript Superset , Expanded JavaScript The grammar of , So the existing JavaScript Code can be associated with TypeScript Working together without any modification ,TypeScript Provide static type checking at compile time through type annotation .
TypeScript Can deal with the existing JavaScript Code , And only for one of them TypeScript Code to compile .
use TypeScript Write a Hello world Program
TypeScript Classic examples on the official website :
npm install -g typescript
function Greeter(greeting) {
this.greeting = greeting;
}
Greeter.prototype.greet = function() {
return "Hello, " + this.greeting;
}
// Oops, we're passing an object when we want a string. This will print
// "Hello, [object Object]" instead of "Hello, world" without error.
let greeter = new Greeter({message: "world"});
let button = document.createElement('button');
button.textContent = "Say Hello";
button.onclick = function() {
alert(greeter.greet());
};
document.body.appendChild(button);【 Summary 】:
TS Elegant code , concise . Write it down , Seems to be writing C#, Is there such a feeling , Because it follows C# All from a master --Anders.
边栏推荐
- Onemanager and cloudflare workers deployment and installation - binding domain names and using cloudflare CDN acceleration
- Free and open source website navigation source code collection, sorting and summary - self built personal navigation Homepage
- Converter
- profile环境切换
- MySQL1
- Zooinspector Download
- Install SSL Certificate in Litespeed web server
- [in depth study of 4g/5g/6g topic -39]: urllc-10 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -3- how to distinguish urllc services? Detailed expl
- MySQL final chapter
- Emergency lighting design of large stadiums and gymnasiums
猜你喜欢

This visual analysis library makes it easy for you to play with data science!

Pam4 popular science
![[JVM learning 04] JMM memory model](/img/8c/0f76be122556301a5af140e34b55f4.png)
[JVM learning 04] JMM memory model

asp. Net coree file upload and download example

Machine learning_ Data processing and model evaluation

Pay close attention! List of the latest agenda of 2022 open atom open source Summit

Analysis of the basic concept of digital warehouse
![[resolved] CVC datatype valid. 1.2.1: '' is not a valid value for 'ncname'.](/img/27/ae15e553eba99acf19beb93a3e9939.jpg)
[resolved] CVC datatype valid. 1.2.1: '' is not a valid value for 'ncname'.
![[JVM learning 03] class loading and bytecode Technology](/img/b4/9482b02b58580171235fd4c36129e9.png)
[JVM learning 03] class loading and bytecode Technology
![[laser principle and application -6]:q switching element and Q drive circuit board](/img/30/e199b73fb9b0ad335f26f2378cfc45.png)
[laser principle and application -6]:q switching element and Q drive circuit board
随机推荐
MySQL sort. Sort by field value
Decision tree_ ID3_ C4.5_ CART
Chapter 4 compound type
Using videoview to realize video playback in turns
Leetcode652 finding duplicate subtrees
原反补及大小端
Rotation matrix derivation process
Hangdian multi School Game 1 question 3 backpack (XOR dp+bitset)
He has been in charge of the British Society of engineering and technology for 13 years, and van nugget officially retired
OpenGL learning (III) glut two-dimensional image rendering
Compressed string
[in depth study of 4g/5g/6g topic -39]: urllc-10 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -3- how to distinguish urllc services? Detailed expl
拿捏C指针
Detailed explanation of ELF format (I)
How does PostgreSQL decide PG's backup strategy
Sword finger offer 42. maximum sum of continuous subarrays
Detailed explanation of the relationship between MySQL tables
Siyuan notes V2.1.2 synchronization problem
mysql排序.按字段值排序
First knowledge database