Skip to content

Conversation

@Ghaida-jaaisa
Copy link

No description provided.

@Ghaida-jaaisa
Copy link
Author

Done

Copy link
Contributor

@sarah-abu-zeineh sarah-abu-zeineh left a 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));
Copy link
Contributor

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

Copy link
Contributor

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?

@Ghaida-jaaisa
Copy link
Author

Sorry to be late,
I fix the mentioned bugs

function simulateInputChange(callback) {
callback('updated');
}
simulateInputChange(formHandler.onChange.bind(formHandler));
Copy link
Contributor

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?

Comment on lines 25 to 32
const translator = {
language: 'Arabic',
getLanguage() {
return `Current language: ${this.language}`;
}
};
function logLanguageInfo(getter) {
const boundGetter = getter.bind(translator);
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Ghaida-jaaisa
Copy link
Author

I change the functions to arrow behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants