内置对象

如何一次性创建多个对象

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()

posted @ 2021-12-05 13:42  梦话!  阅读(85)  评论(0编辑  收藏  举报