内置对象
如何一次性创建多个对象
function creatObj(){ let obj=new Object(); obj.name='haha'; obj.age=23; obj.say=function(){ console.log('我是'+obj.name+,'我的年龄是'+obj.age) } return obj; } person1=createObj() person1.say();
内置对象:Math,Date,String,Array,Object
内置对象中Math的常用方法
Math.PI
Math.abs()
Math.ceil()
Math.floor()
Math.max()
Math.min()
Math.pow()
Math.sqrt()
Math.random()