TypeScript笔记五

/**
 * Created by ufo9631 on 2017/5/17.
 */
var myArr=[1,2,3,4,5];
myArr.desc="five number";
myArr.forEach(value=>console.log(value)); //forEach不能使用break

for(var n in myArr)
{
    console.log(n);
}

for(var x of myArr)
{
    console.log(x);

}

  

posted @ 2017-11-15 22:50  编程猴子  阅读(107)  评论(0编辑  收藏  举报