event.target Points to element, which triggers the event.

event.currentTarget Points to element, to which the Event Listener is attached to.

Confused?

Let’s consider this example, where a button is nested inside a paragraph and both button and paragraph having click event.


As our server has multiple API endpoints, our need for creating routes increases, along with increased demand of creating these routing files.

Traditionally, we were importing every single file that pertains to a specific route, to the root file as a middle ware. …


Before Node version 13, we were using the esm npm package and run our app.js using the commandnode -r esm app.js

With recent updates of Node, this is natively supported now. There are two ways we can achieve it

  • Save the file with .mjs extension.
  • Add { "type": "module" } in the nearest package.json.

Note that we only have to do one thing from the above mentioned.

If we are using Node.js version 8–12, save the file with ES6 modules with .mjs extension and run it like:

node --experimental-modules app.mjs

Leaving a clap will motivate me to write more useful tips related to JS.


[Interview Question] — Find the largest and smallest word in a sentence!

Input — “This is a sentence and I am about to find out the largest and smallest word occurring in this line”

Output —

Largest Word — occurring

Smallest Word — a

Try on your own and leave a reply containing your way of doing so!

Solution — Used Decoder…


[Interview Question] — Get the product of all the elements of an array except the current Element and return the result as an array!

Input — [2, 3,4,5]

Output — [60, 40,30,24]

Try on your own and leave a reply containing your way of doing so!

Solution — Used Decoder (an Android app) to create this solution because I was lazy enough to not to turn on the laptop 😁

Explanation:

Step 1: Loop…


This article will be explaining about the React Hooks. Working as a Software Engineer at SimbaQuartz, I use React as the frontend with React Hooks in Projects every other day. …


As working with Angular Material 8 DatePicker Component, i was not able to set the Date in a specific format. After spending 2 hours of researching, i achieved the Goal by following multiple articles. …


After Jumping from React to Angular, The First thing i fall in love was TypeScript. I loved it so much that i have planned it to use in React instead of normal JavaScript.

While importing a module called Busboy as like this:

import * as Busboy from “busboy”;

The Error was like this:

Could not…


ES10 is not as significant as ES6 in terms of new language features but it does add several interesting ones.

1. String.matchAll()

const matchIterator = str.matchAll(regExp);

Given a string and a regular expression, matchAll() returns an iterator for the match objects of all matches.

2. Array.flat() & Array.flatMap()

The flat() method creates a new array with all sub-array elements concatenated…


In this Story, lets talk about how we can find out if a variable holds array or object values? Lets declare two separate variables named array and obj.

const array = [1,2,3,4,5];
const obj = {id: 1, name: “Josh”};

Now, you might be thinking that we can use typeof operator…

Amandeep Kochhar

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