摘要: 如何获取变量的类型(typeof) let n=5; let a='xuyan' let b=0 let null=null let obj=new Object() console.log(typeof n,typeof(s),typeof b,typeof null,typeof obj) 执行 阅读全文
posted @ 2021-12-05 14:07 梦话! 阅读(161) 评论(0) 推荐(0)
摘要: 如何一次性创建多个对象 function creatObj(){ let obj=new Object(); obj.name='haha'; obj.age=23; obj.say=function(){ console.log('我是'+obj.name+,'我的年龄是'+obj.age) } 阅读全文
posted @ 2021-12-05 13:42 梦话! 阅读(95) 评论(0) 推荐(0)