The end is nigh

Taylor Cannetti
2 min readNov 13, 2020

Talk about something you learned in class this week.

This week we learned about currying and recursion. Recursive functions seem extremely useful due to them helping to break down complex problems into steps. This seems to help you have less instances where a bug will break the entire function.

Explain Function.prototype.bind()

“The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.” MDN web docs

“It allows you to create a new function from an existing function, change the new function’s this context, and provide any arguments you want the new function to be called with. The arguments provided to bind will precede any arguments that are passed to the new function when it is called.” Freecodecamp

Describe event bubbling.

Event bubbling starts at the innermost element and triggers that first, it then will trigger the next innermost and on and on until it reaches the outermost element on the DOM.

What’s the difference between the window load event and document DOMContentLoaded event?

The load event isn’t fired until everything has been loaded on the DOM including stylesheets, script files, and anything else that was included in the files. The DOMContentLoaded event will fire right when the page DOM is loaded and not wait for the other resources to finish loading.

Describe the call stack.

The call stack is a mechanism to keep track of function calls.

“When you execute a script, the JavaScript engine creates a Global Execution Context and pushes it on top of the call stack.

Whenever a function is called, the JavaScript engine creates a Function Execution Context for the function, pushes it on top of the Call Stack, and starts executing the function.

If a function calls another function, the JavaScript engine creates a new Function Execution Context for the function that is being called and pushes it on top of the call stack.

When the current function completes, the JavaScript engine pops it off the call stack and resumes the execution where it left off in the last code listing.

The script will stop when the call stack is empty.” Resource

--

--