官术网_书友最值得收藏!

Questions

Here are some questions to test what you have learned in this first chapter. The answers can be found in the appendix.

Good luck!

  1. What are the 5 primitive types?
  2. What would the inferred type be for the flag variable be in the following code?
 const flag = false;
  1. What's the difference between an interface and a type alias?
  2. What is wrong with the following code? How could this be resolved?
class Product {
constructor(public name: string, public unitPrice: number) {}
}

let table = new Product();
table.name = "Table";
table.unitPrice = 700;
  1. If we want our TypeScript program to support IE11, what should the compiler--target option be?
  2. Is it possible to get the TypeScript compiler to transpile ES6 .js files? If so, how?
  3. How can we prevent console.log() statements from getting into our code?
主站蜘蛛池模板: 通道| 吉林省| 武穴市| 鹿泉市| 沁水县| 广南县| 福清市| 锡林浩特市| 通州区| 青神县| 太原市| 洮南市| 田林县| 保定市| 湘潭县| 庆阳市| 金坛市| 西平县| 施甸县| 基隆市| 高平市| 临猗县| 东阿县| 察隅县| 淮北市| 商水县| 锡林郭勒盟| 南城县| 洮南市| 塔河县| 同江市| 辽宁省| 合作市| 西藏| 南宫市| 贵南县| 来凤县| 莒南县| 石狮市| 河曲县| 比如县|