Simple examples of using JavaScript classes

From , 4 Years ago, written in JavaScript, viewed 53 times.
URL https://pastebin.vip/view/0f9cfb7a
  1. function Person(name, age, email){
  2.         this.name = name;
  3.         this.age = age;
  4.         this._email = email;
  5. }
  6.  
  7. function _Person_show_me(){
  8.         alert('我叫' + this.name + ',我' + this.age + '岁了,我的email是' + this._email);
  9. }
  10.  
  11. Person.prototype.show_me = _Person_show_me;
  12.  
  13. var he = new Person('小何', 28, 'baijun.he@163.com');
  14. he.show_me();
  15. //javascript/4342

Reply to "Simple examples of using JavaScript classes"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website