Tutorials
NodeJS Promises vs aSync

1. Promises A Promise is an object representing a value that will be available in the future (resolved or rejected).It’s the foundation of async handling in modern JS. Example: 👉 You attach .then() for success, .catch() for errors.👉 Chaining works, but deeply nested .then() can get messy. 🔹 2. async/await async/await is syntax sugar on […]

Read more
Tutorials
NojeJs How to remember Assertions

The Mental Model: "Action vs Comparison" 1. Comparison Assertions - Compare two values These take two values (actual, expected) javascript // Pattern: assert.method(ACTUAL, EXPECTED) assert.equal(actual, expected) assert.strictEqual(actual, expected) assert.deepEqual(actual, expected) assert.deepStrictEqual(actual, expected) Memory trick: "Equal" in the name → needs two things to compare. 2. Action Assertions - Test behavior/actions These take a function that performs an action javascript // Pattern: assert.method(ACTION_FUNCTION) assert.throws(() => { […]

Read more
Tutorials
NodeJs Event Loop

Deep Dive into the Node.js Event Loop This document provides a comprehensive explanation of the Node.js Event Loop, including its phases, the difference between blocking and non-blocking I/O, the role of timers and immediates, how yielding works, and the implications of CPU-heavy tasks in Node.js. 1. What is the Event Loop? Node.js is built on […]

Read more