variable type
* Typescript 支援 string, boolean, number, array, enum, any, void 等 types
var vs let
* var 是全區的變數而 let只會在當前的 block scope 有用
"use strict";
function scopeTest(){
if(true){
var foo = "hello";
var bar = "world";
}
console.log(foo) // works!!
console.log(bar) // error!!
}
Enum
"use strict";
enum Category { Book, CD, Computer}