`

判断输入类型

阅读更多

//判断输入是否是数字

function cube(x) {

  if (typeof(x) != 'number') return 0;

  return x * x * x;

}

 

// Once you uncomment the type check in line 2, the

// cube function should return 0.

cube("test");

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics