Category: Fundamentals


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...


css specificity interview question

Specificity allows browsers to decide which CSS property values are the most relevant to an element and, therefore, will be applied. Specificity only applies when the same element is targeted by multiple declarations. Inline...


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...


css – align text to an image vertically

Have you ever wanted to align the text next to an image vertically? It can be done using vertical-align property as shown below. Here, we show how to align the text to top, middle,...


simple css reset

I use the following css reset in almost all my projects. It does the job for me. I hope it helps you, too. [codepen_embed height=”266″ theme_id=”0″ slug_hash=”YqvbwN” default_tab=”result” user=”kavitshah8″]See the Pen simple css reset...


imperative vs declarative/functional programming

Imperative Programming : It specifies a series of instructions that the computer executes in sequence. For example, the following function uses imperative approach for finding the square of each element in the given array....


Default function parameters

The default function parameters in ES6, gives us the ability to initialize the function arguments with default values in case if they are undefined. For example, function mult(a, b) { b = typeof b...


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