Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. var test = function(firstname, lastname){
  2. this.firstname = firstname;
  3. this.lastname = lastname;
  4. }
  5.  
  6. test.prototype.hello = function(){
  7. console.log(this);
  8. console.log('Hello! ' + this.firstname);
  9. }
  10.  
  11. let tester = new test('a', 'b');
  12. tester.hello();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement