RDRohit Dasuinblogs.rohitdasu.dev·May 17, 2024 · 3 min readUnderstanding Promise.any() in JavaScriptIntroduction The Promise.any() static method takes an iterable of promises as input and returns a single Promise. This returned promise fulfills when any of the input promises fulfills, with the value of the first fulfilled promise. It rejects when a...00
RDRohit Dasuinblogs.rohitdasu.dev·May 16, 2024 · 3 min readA Guide to Promise.all() in JavaScriptIntroduction The Promise.all() static method takes a list of promises as input and returns a single Promise. This returned promise is fulfilled when all the input promises are fulfilled (including when an empty list is passed), with an array of the f...00
RDRohit Dasuinblogs.rohitdasu.dev·May 14, 2024 · 3 min readJavaScript Promises Explained SimplyDefinition A Promise is a placeholder for a value that may not be known when the promise is created. It lets you attach handlers to an asynchronous action's eventual success or failure. This allows asynchronous methods to return values like synchrono...00
RDRohit Dasuinblogs.rohitdasu.dev·May 13, 2024 · 2 min readThe most confusing array methodReduce() is not just another array method; it's more than that. Do you think I'm exaggerating? No, I'm not. Keep reading below to find out why. This array method requires two arguments: Callback function This callback function is invoked with the f...00
RDRohit Dasuinblogs.rohitdasu.dev·May 12, 2024 · 1 min readIs Closure in JS really that complicatedThe definition Closure is bundling of two or more functions, where inner function has access to the properties and methods of the outer functions. function calculate() { var num1 = 10; function add(num2) { return num1 + num2; // retur...00