判断输入门类

判断输入类型//判断输入是否是数字function cube(x) {? if (typeof(x) ! number) return 0? return x

判断输入类型

//判断输入是否是数字

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");