js还有这么一种类似强类型语言的写法

在一个老外的开源项目中看到的,感觉不错,学习了:

var matrix:{name: string; gitDir: string; }[] = [  
    {
        name: "bare repository",
        gitDir: "./test/fixture/bare.git"
    },
    {
        name: "cloned repository",
        gitDir: "./test/fixture/vanilla/.git"
    }
];