Created
January 18, 2019 08:40
-
-
Save vishivish18/fc942201f6b29a49f050a54017669d60 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var wizard = { | |
| schoolName: 'Hogwarts', | |
| headMaster: 'Professor Dumbeldore ', | |
| getWizardName: function(firstname, lastname) { | |
| var fullname = firstname + ' ' + lastname; | |
| return fullname; | |
| }, | |
| getSchoolNameAndHeadMaster: function(){ | |
| return this.headMaster + " will be your headMaster at "+ this.schoolName | |
| } | |
| }; | |
| var diagonAlly = function(favoriteSpell, wizardingHouse, firstname, lastname) { | |
| console.log(this.getWizardName(firstname, lastname) + ' Welcome to Hogwarts!!!'); | |
| console.log(this.getWizardName(firstname, lastname) + '\'s favorite spell is ' + favoriteSpell + ' and is sorted to ' + wizardingHouse + ' house'); | |
| console.log(this.getSchoolNameAndHeadMaster()) | |
| }; | |
| var welcomeWizard = diagonAlly.bind(wizard); | |
| welcomeWizard('Expecto Petronum','Griffindor', 'Harry', 'Potter'); | |
| welcomeWizard('Wingardum Leviosa','Griffindor', 'Hermoine', 'Graneger'); | |
| welcomeWizard('Crucify','Slytherin', 'Draco', 'Malfoy'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment