Web is the ultimate place for applications and services
I consider closures and higher order functions to be one of the most powerful language features, if not the most powerful. Here is a 2-liner function that uses both of them. Comes in handy for testing, debugging and measuring performance of some chun...
On frontend, you may have a piece of code that rapidly fires network requests, based on user interaction. Debouncing such actions becomes less and less a viable option because of user experience. Especially with advent of React.js Suspense which deal...
I keep forgetting how communication between a main window and an iframe works because I don't use it so often. Most articles go in depth of how and why, rather than serve as a quick recap, so I'll try to do that here. main window and an iframe can e...
Let's build on top of simple one-liner I've written about previously that allows you to pause code execution. Here it is one more time: const pause = time => new Promise(resolve => setTimeout(resolve, time)) Simply combine it with Promise.race functi...
To keep it short, this post only deals with a simple pause function: const pause = time => new Promise(resolve => setTimeout(resolve, time)) pause function returns a Promise when called. The Promise itself resolves after a specified amount of time, ...
Handling exceptions in the async/await functions can become really bothersome. You can have multiple await calls inside a function for which you need to handle exceptions separately. This requires either wrapping every await call inside its own try/c...