We often come across the term High-Order function when working with Functional programming. High-Order function is nothing but a pure function that can take one or more functions as arguments or returns a function as output when invoked.

Hig-Order function

Let’s take an example to understand better.

Example #1: In the example below, a concatStr function is a higher-order function that returns a function that takes a sentence as an argument and appends the lang which is passed as an argument to the value that is being returned.

function concatStr(lang){  return function(sentence){       return `${lang} ${sentence}`  }}const progLang = concatStr('JavaScript');console.log(progLang('is…

Console is an object which provides access to the browser debugging console and console.log is widely used. But, the JavaScript world is not limited only to console.log, it has various methods which makes debugging more productive and efficient.

Some of you may be using alert() Method for debugging but I personally try to avoid using it because of certain limitation:-

1. When we try to print a JavaScript object it doesn’t show the real data instead it always return [Object Object].

2. When we use it in a loop it makes things more difficult to handle.

3. When we move…

React Hooks (>16.8): Hooks provide us to use states (react objects) in a functional component. Hooks help us to work with state, effect, and context which were once only possible in React Class. It provides a more direct API to the React concepts like props, state, context, refs, and lifecycle. Hooks are backward compatible and it’s not a replacement for React Class.

Let’s understand the React hook concept better by taking a Class component and Functional component example.

Let's write a logic where we try to set a state which holds the value of the switch. Based on the clicking…

Context API(>React’s version 16.3) — The Context API provides a way to share data between components without having to pass a prop through every level of the component tree. Context API is not a total replacement for the lib like Redux or MobX or any other state management library.

Let’s consider a scenario to understand the prop-drilling problem and how Context API helps us to overcome it.

We have a state called Language defined in our App component which we need to pass to the Child Component 2 & 3 from the parent component. …

I believe we all would have come across a scenario where we need to push the changes from client to server and vice-versa. In most of the case, you may have used AJAX(Asynchronous JavaScript And XML) to do that without reloading the whole page. But in certain cases where we want to have a persistent connection to the server, Socket.io will be the best option. Let’s jump in and explore more about Socket.io.

What is Socket.io?

Socket.IO is a JavaScript library for Realtime web. It was developed in 2010. Socket.io is built on top of Engine.io — which is the…


I’m a software developer and a continuous learner. #reactjs #javascript #jquery #nodejs #erp #mongo #php

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store