当前位置:网站首页>Type de Typescript
Type de Typescript
2022-06-26 06:19:00 【Un devant.】
typeL'écriture courante de:
//Non utilisétype
let sum:(x:number,y:number) => number
sum=(x,y)=>x+y
const result = sum(1,2)
console.log(result)
//Utilisertype
type PlusType=(x:number,y:number)=>number
let sum2:PlusType=(x,y)=>x+y
const result2=sum2(2,3)
console.log(result2)
// typeCombinaison du type de Fédération
type strOrNum=string|number
let result3:strOrNum='12'
result3=12
//Plus souvent
type Directions='Up'|'Down'|'Left'|'Right'
let toWhere:Directions='Down'
//typeInterface de liaison
interface IName{name:string}
type IPerson=IName&{age:number}
let person:IPerson={name:'jim',age:123}边栏推荐
猜你喜欢

Gof23 - abstract factory pattern

MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

Tortoise and rabbit race example

连接数服务器数据库报:错误号码2003Can‘t connect to MySQL server on ‘服务器地址‘(10061)
Web components series (10) -- realize the basic layout of mycard

去哪儿网BI平台建设演进史

Ppt template crawler case

数据可视化实战:实验报告

Tencent WXG internship experience (has offered), I hope it will help you!
[alluxio & Dachang] the original boss direct employment was applied in this way
随机推荐
04. basic data type - list, tuple
Use the fast proxy to build your own proxy pool (mom doesn't have to worry about IP being blocked anymore)
Pytorch uses multi GPU parallel training and its principle and precautions
Playing RTSP streaming video on Web pages (webrtc)
MySQL-07
Gof23 - abstract factory pattern
温度报警器
架构设计方法
Getting to know concurrency problems
Unsatisfied dependency expressed through field ‘baseMapper‘; nested exceptio
The interviewer with ByteDance threw me an interview question and said that if I could answer it, other companies would have an 80% chance of passing the technical level
成水最多的容器
TS泛型在函数、接口、类中使用介绍
DPDK——TCP/UDP协议栈服务端实现(一)
Import export simple
数据可视化实战:实验报告
消息队列-消息事务管理对比
【Spark】Spark SQL 字段血缘如何实现
302. 包含全部黑色像素的最小矩形 BFS
技术Leader的思考技巧