Feb 7 · 3 min read · A function that: Accepts another function as an argument, Or Returns a function. const diameter=function(radius){ return 2*radius; } Array.prototype.calculate = function(logic) { const output = []; for (let i = 0; i < this.length; i++) {...
Join discussionAug 29, 2025 · 6 min read · Arrays are one of the most important parts of JavaScript. Often, we need to loop through arrays and perform some action — like doubling numbers, filtering values, or adding everything together. JavaScript gives us some very useful methods: forEach()...
Join discussionAug 26, 2025 · 2 min read · 🔹 What is Boolean? Boolean is a built-in JavaScript function that converts any value into either: true ✅ (if the value is truthy) false ❌ (if the value is falsy) It basically answers: “Is this value truthy or falsy?” Examples: Boolean(1); ...
Join discussion
Jun 10, 2025 · 4 min read · Introduction While working on a recent project, I came across a requirement where users needed to filter a list of suppliers dynamically based on either the business name or the business type. Initially, all suppliers were shown in a dropdown, but on...
Join discussion
Dec 10, 2024 · 1 min read · The choice between filter and splice depends on your specific requirements: Use filter (Better for Immutability): this.users = this.users.filter(user => user.id !== id); Immutability: Creates a new array without modifying the original one. Readabl...
Join discussionOct 15, 2024 · 6 min read · 1. forEach() Function The forEach() method is used to execute a provided function once for each element in an array. It does not return a new array; it simply iterates over the array. Syntax: array.forEach(callback(currentValue, index, array)); cal...
Join discussionSep 14, 2024 · 3 min read · What is ‘URLSearchParams’ in JavaScript? MDN : The URLSearchParams interface defines utility methods to work with the query string of a URL.MDN reference 💡 When you visit a shopping site and search for a product, then share the link with your fri...
Join discussion