Author: Saim Khalid
-
Mutability vs Immutability
If you are a web developer you have seen the terms mutable and immutable objects in JavaScript. But what these words mean, and why do they matter? This section will help you understand. This knowledge is very helpful for writing cleaner, safer, and more reliable JavaScript code. Mutable Objects Mutable objects in JavaScript are ones…
-
Minifying JS
JavaScript enables dynamic and interactive features on websites and web apps. It is a key component of modern web development. But as JavaScript files grow larger and more complex, they can significantly affect page load times and overall speed. To solve this issue, developers use techniques like code minification to make JavaScript code simpler without…
-
Memoization
As our systems grow and start doing more complex calculations, the need for speed grows and process optimization becomes necessary. Ignoring this issue results in applications that use a lot of system resources and operate slowly. In this chapter, we will discuss memoization, a technique that can significantly reduce processing time when used properly. What…
-
Local Storage
This chapter will show you how to use JavaScript’s localStorage to save data for several browser sessions. We will demonstrate how to use this method using the Window.localStorage property, as well as go over the principles of web storage in JavaScript. What is localStorage in JavaScript? The localStorage feature allows JavaScript apps and websites to save key-value…
-
Lexical Scope
What is Lexical Scope? Lexical scope refers to an expression’s definition area. In other words, an item’s lexical scope is the context in which it was generated. Lexical scope is sometimes known as static scope. The lexical scope of an item is not always determined by where it was invoked (or called). The lexical scope…
-
Kaboom.js
Kaboom.js makes it easy to create JavaScript games. You can add physics, detect collisions and make sprites in addition to controlling different scenes. By using Kaboom.js, you can focus on making an engaging and creative game instead of writing complex code. Think about adding other features like backgrounds, power-ups or scoring to further enhance your game!…
-
Immutability
Immutable means that something that cannot be changed. In programming, immutable means a value that cannot be changed once set. Most programs require the generation, modification, and deletion of data. So, why would anyone want to deal with immutable data? In this tutorial, we will look at the immutability of primitives, arrays, and objects using…
-
Function Composition
Function composition is a powerful functional programming approach that allows programmers to combine numerous functions into a single function. This compositional method enhances readability, modularity and code reuse. The compose function is important for JavaScript’s ability to provide function composition. What is Function Composition? The method of combining several functions to create a new function…
-
Execution Context
We will learn about the JavaScript execution context in this chapter, where we will also cover its types, definition, execution stack, creation process, and overall execution phase. We will go over each topic individually. First, let’s get started with the introduction. What is Execution Context? The execution context is a term that describes the internal…
-
Engine and Runtime
A JavaScript engine is a computer software that executes JavaScript code. It is responsible for translating human-readable JavaScript code into instructions that the hardware of the computer can understand. When JavaScript code is executed in a browser, it does not make direct contact with your computer’s hardware. Rather, it communicates with the JavaScript engine, which…