Front End Development, MEAN

Why and how finally{…} block is NOT meaningless

A definition first (from the internet): try-catch-finally is used to handle runtime errors and prevent them from halting the execution of a program. The finally block triggers regardless of: what is implemented inside the try-catch block any errors encountered inside try-catch block any return statement written...

by shivang.chaturvedi
Tag: Computer Science
25-Jan-2023

MEAN, Node.js

Top level await() without async() function in NodeJs

Here’s how async-await function typically works: function myDummyBackendCall() { return new Promise((resolve) => { setTimeout(() => { resolve({ name: "Shivang", id: "asmdhajkdhajdsh8qweuqoweuiqepoi-0q-0eueiuaisjdaKcjaisku", }); }); }); } // Used an async wrapper function to make an await call (async () => { ...

by shivang.chaturvedi
Tag: Computer Science
24-Jan-2023