-
Notifications
You must be signed in to change notification settings - Fork 42
Ghaidaa - Arrow Functions and This Assignment Submission #32
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
base: main
Are you sure you want to change the base?
Conversation
|
Done |
sarah-abu-zeineh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the code based on the suggestion I gave it to u.
| function simulateInputChange(callback) { | ||
| callback('updated'); | ||
| } | ||
| simulateInputChange(formHandler.onChange.bind(formHandler)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use arrow function as another solution here and explain why it could work, and please explain why u use bind here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the arrow function?
|
Sorry to be late, |
| function simulateInputChange(callback) { | ||
| callback('updated'); | ||
| } | ||
| simulateInputChange(formHandler.onChange.bind(formHandler)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the arrow function?
| const translator = { | ||
| language: 'Arabic', | ||
| getLanguage() { | ||
| return `Current language: ${this.language}`; | ||
| } | ||
| }; | ||
| function logLanguageInfo(getter) { | ||
| const boundGetter = getter.bind(translator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u had to use the arrow function in this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and explain why u use bind or the arrow function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
I change the functions to arrow behavior |
No description provided.