Tagged: javascript

0

Dynamic module loading with require

Let’s say we have ./darwin.js for mac, ./win32.js for Windows in the current working directory. And we want to require one of them in ./index.js based on which platform the file is being ran....

0

Error handling in promises interview question

Let’s quickly revise some of the fundamentals of the promises, before we jump into the best practices and anti-patterns for error handling in JavaScript promises. What is a promise? It is an object which...

0

exports is not defined

This is very common error when your project has ES6 modules as well as require.js module systems. Here, I will show you few examples on how to require ES6 modules inside an AMD module....

1

Parse html response with fetch API

We will learn how to read the html response returned from REST API end point which was called using the new fetch API. The Fetch API provides an interface for fetching resources (including across...

0

Pure vs Impure functions

Characterestics of Pure Functions The return value of the pure functions solely depends on its arguments Hence, if you call the pure functions with the same set of arguments, you will always get the...

Show Buttons
Hide Buttons