Handle unhandledRejection and uncaughtException in express node js
Some time it is difficult to handle all error or exceptions. Even then we need to capture these error or exception for debug purpose or to show proper message to…
Some time it is difficult to handle all error or exceptions. Even then we need to capture these error or exception for debug purpose or to show proper message to…
If we have array of object and we want to find unique object from the array then it become tedious if we are not using/want any external library. Let try…
The JavaScript has substring() method returns the part of the string between the start and end indexes, or to the end of the string. But slice() also another way to get substring from…
We can execute external command or any process from the node js. With the help of child_process module we can achieve it. 1. var spawn = require('child_process').spawn, ls = spawn('cmd.exe',…
The btoa() function takes a JavaScript string as a parameter. In JavaScript strings are represented using the UTF-16 character encoding: in this encoding, strings are represented as a sequence of 16-bit (2…
Objects in JavaScript can be thought of as maps between keys and values. We can remove these keys, more commonly known as object properties. In this tutorial, we will learn…
There may be a requirement to merge or flatten the array of array for better representation or readability. There are various ways to achieve this in javascript. We will try…
Sometime we need to get last element of array. Even when we do not know size of array. There are several way to achieve it. Lets explore few ways. 1.…