1213-Throwback / Project_2

0 stars 0 forks source link

Make sure that "this" holds the original value when callback function is run #9

Closed Vulcran closed 1 year ago

Vulcran commented 1 year ago

Getting this to work was really difficult for me because I could not think of what this was in relation to. I found out that this references the function itself that is being run. I had to remember that my code was where the callback function was being called. That meant that I could pass in any parameters to the function and I can control its "this" value by passing in one more argument than expected (in the front) to set its "this" value