TypeScript : Colon vs Equal To ( Angular Tutorial )

后端 未结 6 1812
Happy的楠姐
Happy的楠姐 2020-12-06 10:35

I am learning Angular4 and going through the tutorial examples.

https://angular.io/docs/ts/latest/tutorial/toh-pt1.html

I have the below code in the tutoria

6条回答
  •  温柔的废话
    2020-12-06 10:58

    Because it's Typescript, not JavaScript. Typescript have that style of variable data type definition. That's the big advantage in TypeScript: Full oop and typesafe variables.

提交回复
热议问题