Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query regarding bind #71

Open
TayyabaZainab0807 opened this issue Apr 9, 2020 · 0 comments
Open

Query regarding bind #71

TayyabaZainab0807 opened this issue Apr 9, 2020 · 0 comments

Comments

@TayyabaZainab0807
Copy link

Its not an issue but a query

`// Lecture: Bind, call and apply

var john = {
name: 'John',
age: 26,
job: 'teacher',
presentation: function(style, timeOfDay) {
if (style === 'formal') {
console.log('Good ' + timeOfDay + ', Ladies and gentlemen! I'm ' + this.name + ', I'm a ' + this.job + ' and I'm ' + this.age + ' years old.');
} else if (style === 'friendly') {
console.log('Hey! What's up? I'm ' + this.name + ', I'm a ' + this.job + ' and I'm ' + this.age + ' years old. Have a nice ' + timeOfDay + '.');
}
}
};
var emily = {
name: 'Emily',
age: 35,
job: 'designer'
};

var johnFriendly = john.presentation.bind(john,null, ,'morning');
johnFriendly('friendly');`

Is there any way to fix the second parameter ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant