What is recursion and when is it useful?

Recursion is the repeated application of a process. In JavaScript, recursion involves functions that call themselves repeatedly until they reach a base condition. The base condition breaks out of the recursion loop because otherwise the function would call itself indefinitely. Continue reading What is recursion and when is it useful?

What are defer and async attributes on a Script tag?

If neither attribute is present, the script is downloaded and executed synchronously, and will halt parsing of the document until it has finished executing (default behavior). Scripts are downloaded and executed in the order they are encountered. The defer attribute downloads the Continue reading What are defer and async attributes on a Script tag?

How do you ensure methods have the correct this context in React component classes?

In JavaScript classes, the methods are not bound by default. This means that their this context can be changed (in the case of an event handler, to the element that is listening to the event) and will not refer to the component Continue reading How do you ensure methods have the correct this context in React component classes?