為什么不能將Math()作為函數名?
function Math(x){
??? document.write(Math.ceil(x)+"<br/>");
??? }
Math(3.3);
Math(-0.1);
Math(-9.9);
Math(8.9);
請問為什么不能將Math()作為函數名,而一定要用小寫的math()呢?
function Math(x){
??? document.write(Math.ceil(x)+"<br/>");
??? }
Math(3.3);
Math(-0.1);
Math(-9.9);
Math(8.9);
請問為什么不能將Math()作為函數名,而一定要用小寫的math()呢?
2015-12-10
舉報
2015-12-10
Math是js內置對象,相當于保留字,和不能用function作為函數名一個道理