I have a problem with the snippet below : everything works perfectly when I press the button on the 1st page. But it tells me that “secondPageItems” is not defined when I press the button on the 2nd page. (here every thing works fine because it’s on the same HTML page) Even stranger, if I put “secondPageItems” and “secondPageHiden” above
Tag: arguments
Pass an object’s method to a function in Javascript. Is this the correct interpretation of the question?
I was in an interview, and there was this question: When the method X of an object O is passed to a function Y as a parameter, what happens if X contains a reference to ‘this’ and gets executed inside Y? Please provide code examples. Is this code a correct interpretation of the question? Could you please help me understand
A function creating variable names for parameters that I never gave
I am learning JavaScript from an eloquent book and in the chapter about higher order functions I found this code: function noisy(f) { return function(…args) => { console.log(“calling …