Publisher–Subscriber Pattern in JavaScript (Simple Implementation)The Publisher–Subscriber (Pub-Sub) pattern is a messaging pattern where senders (publishers) do not directly communicate with receivers (subscribers). Instead, subscribers register their interest, and the publisher notifies them when something happen...Dec 25, 2025 · 2 min readbobby-sadhwani.hashnode.dev
Stack in JavascriptWhat is Stack? A stack is an ordered collection of items that follow the (LIFO) Last In First Out principle. The addition and removal of items take place at the same end i.e. at the top. The newest elements are at the top and the oldest elements are ...Aug 29, 2023 · 3 min readbobby-sadhwani.hashnode.dev
Arrow functions in JavaScriptArrow functions were introduced in ES6. It behaves differently from the traditional functions of Javascript. Syntax const functionName = (parameters) => { //function body } const getName = (age) => { let name = 'Bobby'; return `${name} is...Aug 29, 2023 · 4 min readbobby-sadhwani.hashnode.dev
Functions in JavaScriptWhat is a function? A function is a reusable piece of code that takes some input, performs some task and returns a value. A function stores a piece of code that we want to use repeatedly. To use a function, we call that function by its name. // Defin...Feb 25, 2023 · 4 min readbobby-sadhwani.hashnode.dev
Event Loop in JavaScriptJavascript is a synchronous single-threaded language. JS executes all operations on a single thread. It executes one thing at a time. The Event loop gives us the illusion of asynchronous programming in JavaScript. Before understanding the event loop,...Jan 21, 2023 · 4 min readbobby-sadhwani.hashnode.dev