📜  打字稿与 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:43.845000             🧑  作者: Mango

代码示例2
// What differs typescript from javascript is the strict usage of types.
// Javascript is a loosely typed language, 
// while Typescript is strictly typed.

// Javascript
let car = 'BMW';
let age = 15;

// Typescript
let car: string = 'BMW';
let age: number = 15;