Last active
July 27, 2018 23:33
-
-
Save kristyburge/fb827103251f84a8aa0e12826f61456b to your computer and use it in GitHub Desktop.
Create a object type with a constructor function and see 'this' in action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Dog(breed, name, friends){ | |
this.breed = breed; | |
this.name = name; | |
this.friends = friends; | |
this.intro = function() { | |
console.log(`Hi, my name is ${this.name} and I’m a ${this.breed}`); | |
return this; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment