wujindong
 1     //object 对象 属性和方法的使用
 2     var person = new Object();
 3     
 4     person.name="张海";
 5     person.age="60";
 6     
 7     person.say=function(){
 8         console.log(person.name+"他在说话!"+"\t他已经"+person.age+"");
 9     };
10     person.eat=function(){
11         console.log(person.name+":说我们该吃饭了!");
12     }
13     
14     console.log(person.say());//张海他在说话! 他已经60岁
15     console.log(person.eat());//张海说:我们该吃饭了!

 

分类:

技术点:

相关文章:

  • 2021-09-07
  • 2019-09-23
  • 2021-09-04
  • 2022-02-03
  • 2021-09-18
  • 2021-12-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案