当前位置:网站首页>One article makes you understand what typescript is
One article makes you understand what typescript is
2022-07-28 20:24:00 【Front end Xiaobai is moving forward】
Catalog
Bloggers recently entered typescript Learning from , So create a column , Share with you what you are learning ts Some knowledge summary and some own feelings :
special column ===> typescript Entry to elevation
TypeScript What is it?

TypeScript brief introduction
- TypeScript yes JavaScript Superset .
- It's right JS It has been extended , towards JS The concept of type is introduced in , And added many new features .
TS The code needs to be compiled into JS, And then to JS The parser executes.- TS Fully compatible with JS, In other words , Any JS Code can be used directly as JS Use .
- Compare with JS for ,TS With static types , More strict grammar , More powerful features ;TS You can check your code before it executes , Reduces the probability of runtime exceptions ;
TS The code can be compiled into any version of JS Code , It can effectively solve different problems JS Compatibility of operating environment; Same function ,TS The amount of code is greater than JS, But because of TS The code structure of is clearer , Variable types are more explicit ,In later code maintenance TS But far better than JS.
TypeScript What's added ?

TypeScript Development environment construction
- download Node.js
You can go node.js Download on node.js ==> node.js Official website
install Node.js
Use npm Global installation typescript
1. Go to the command line 2. Input :npm i -g typescriptCreate a ts file


Use tsc Yes ts File for compilation
1. Go to the command line 2. Get into ts File directory 3. Carry out orders :tsc xxx.ts



Here we can find , We have already ts The file is compiled , Automatically generated ts file
Summary
I'm concerned about ts The understanding of ,
ts In fact, it is a strict version js, In our daily development ,js Although the code is easy to write , But the code is not rigorous ,ts It's a good solution to this problem , This is only the first article , I believe many friends are right ts The benefits of are not fully understood , Follow my column , Slowly let everyone be right ts Have a deeper insight .
边栏推荐
- Windows系统下Mysql数据库定时备份
- How to automatically store email attachments in SharePoint
- How to use pycharm to quickly create a flask project
- local/chain/run_ tdnn.sh:
- Solve flask integration_ Error reporting in restplus
- Circular linked list OJ question
- WFST decoding process
- [C language] Pointer elementary knowledge points
- 产品经理访谈 | 第五代验证码的创新与背景
- Common instructions of vim software
猜你喜欢

ssm中项目异常处理

C language data 3 (2)

私有化部署的即时通讯平台,为企业移动业务安全保驾护航

Introduction to seven kinds of polling (practice link attached)

C语言数据 3(1)
![[C language] comprehensively analyze the pointer and sort out the pointer knowledge points](/img/71/f4138b68c27d6447fbd5b5e0762929.png)
[C language] comprehensively analyze the pointer and sort out the pointer knowledge points

Const pointer of C language and parameter passing of main function

基于 MinIO 对象存储保障 Rancher 数据

【pytorch】LSTM神经网络

一碰撞就自燃,谁来关心电池安全?上汽通用有话说
随机推荐
CNN convolutional neural network structure
Representation of base and number 2
How to automatically store email attachments in SharePoint
Zfoo adds routes similar to mydog
robobrowser的简单使用
New fruit naming (DP is similar to the longest common subsequence)
Two methods to judge the size end
C+ + core programming
Explain RESNET residual network in detail
[C language] Pointer elementary knowledge points
C language - pointer
Simple example of C language 1
树行表达方式
ssm中项目异常处理
Wust-ctf2021-re school match WP
Storage of C language data in memory (1)
9. Pointer of C language (4) pointer and one-dimensional array, pointer operation
9. Pointer of C language (3) classic program, exchange the value of two numbers for deep analysis, (easy to understand), are formal parameters and arguments a variable?
[C language] Gobang game [array and function]
Torch. NN. Linear() function