Typescript随笔

100 阅读1分钟
:后面的值代表返回值的类型
const scaleNames: { c: string; f: string } = {  c: '摄氏度',  f: '华氏度'};
 名为convert的函数传递的值为number,返回的值为number
convert: (temperature: number) => number)