Essays on software architecture, performance optimization, and systems engineering.
We’re going to discuss the mechanics that runs almost everything in JavaScript.
We discuss JavaScript Modules, how a function or variable can be accessed outside its file, and what rules govern this
In this article, we are going to discuss why variables are accessed in one context, but not the other.
Have you ever wondered what Factory Functions are. Take 2 minutes and know how
Do you know how counters, timers, or event listeners actually work in JavaScript. Take 2 minutes to know how
Ever wondered how let and const behaves when get hoisted, and the behavior of function expressions they state. Take 2 minutes and know how
Most developers know var prints undefined before its declaration. Far fewer know why. It all comes down to what JavaScript does before your code starts executing. I will explain why with simple examples in this article.
Function Hoisting occurs when a function is called before its declaration appears in the source code. JavaScript hoists function declarations to the top of their scope during the creation phase of execution, making them available to call before they are defined in the file. Just imagine it as a pre-step where JavaScript interpreter moves all function declarations to the top of their scopre before executing the code.
While web applications offer several advantages, including low cost, maintenance ease, and cross-platforming, they also have some drawbacks just like everything around us, some drawbacks are limited functionality, performance issues, limited access to device hardware, and dependence on connectivity. And here is where PWAs come in with their unique features to help address some of these drawbacks.
Modern JavaScript provides many ways to iterate or loop through your data. We don’t have one fits all iteration tool, so in case of very large arrays use traditional for loop. In case of medium arrays and need for clean code use while loop. In case of supporting functional programming and optimized time forEach is ideal. In case of small arrays and for fast iteration use for…of loop.”