代码改变世界

something

2016-06-14 15:12  改吧  阅读(154)  评论(0编辑  收藏  举报

var colors=['red','green','yellow'];

console.log(colors)//['red','green','yellow']

console.log(colors.toString());//red,green,yellow

console.log(colors.valueOf());//['red','green','yellow']

console.log(colors.toLocaleString());//red,green,yellow

function num(nums){

  if(nums<=1){

    return 1;

  }

  else{

    return nums*num(nums-1);

  }
}

console.log(nums(5));//120递归函数