Optional Chaining in JavaScript

Optional chaining

Have you ever tried to access a property in JavaScript and got an error because the object was undefined or null? That’s where optional chaining (?.) comes to the rescue! What is Optional Chaining? Optional chaining (?.) is a feature in JavaScript that lets you safely access deeply nested properties without worrying about errors. If … Read more

Closures in JavaScript

Closures are a fundamental concept in JavaScript that allow functions to retain access to variables from their containing scope even after that scope has finished execution. They are one of the most important concepts for mastering JavaScript, especially when working with asynchronous code, event handling, or functional programming patterns. In this article, we’ll break down … Read more

Pass by Value vs Pass by Reference

Passing arguments to functions is a fundamental aspect of programming. How these arguments are passed, and whether they’re treated as references or values, can have a significant impact on how your code behaves. In this article, we’ll delve into how passing arguments in PHP and JavaScript work. PHP Default Behavior: Pass by Value By default, … Read more

JavaScript Promises

JavaScript Promises

JavaScript promises is one of the confusing concepts in web development. In this article we’ll go over what promises are and how we can use them.

JavaScript OOP Using Constructor Functions

JavaScript OOP with Constructor Functions

Object Oriented Programming can be implemented in JavaScript in three ways In this article, I’ll go over the first way, which is using constructor functions. Using constructor functions is the oldest and main method of doing OOP in JavaScript. Our Sample Object Imagine our objective is to be able to programmatically create objects representing cars … Read more

JavaScript this Keyword

this keyword

The “this” keyword in JavaScript can be a source of confusion for developers. In this article, we’ll try to understand this keyword in different contexts.

How DOM Events Work?

DOM Events

In this Article we’ll go over the DOM events, event listeners, event propagation and other useful info about the events.