parseInt(a);
Math.floor(a);
Math.ceil(a);
a.split('.')[0];
Math.ceil(); ceiling(天花板) 所以向上取整 Math.floor();floor(地板)所以向下取整
D选项可以这样: "".split.call(a,".")[0]
Math.ceil 向上取整
Math.floor 向下取整
Math.round 四舍五入
a.split('.')[0]; a这里是number类型 而spilt需要是字符串类型才能用这个 ,控制台执行会返回split not a function
Math.ceil(a)
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题