Category: Javascript
Javascript: Remove Parenthesis from String
This article will remove all brackets from a javascript string using different methods and example illustrations. While developing in any language, removing the parenthesis from a string is common before processing it. We will also discuss removing square brackets and other brackets in this article. Table of Contents:- Javascript String Remove Parenthesis using replace() Javascript …
JavaScript Remove Zeros from a String
This article will remove all zeros from a javascript string using different methods and example illustrations. While developing in any language, removing zeros from a string is common before processing it. Here, we will discuss removing leading zeros, trailing zeros, and other zeros within the string. We will be using replace() and replaceAll() methods of …
JavaScript Remove Hyphens from a String
This article will remove all dashes (‘-‘) from a javascript string using different methods and example illustrations. While developing in any language, removing dashes or hyphens from a string is common before processing it, as it might be a phone number, for example. Table of Contents:- Javascript String Remove Hyphens using replace() Javascript String Remove …
Get Unique Values from an Array of Objects
Arrays are used to store different values in the same variable. An array of objects is used to store various objects within an array. While working with objects and array of objects, we often need to get unique values and process them. This article will discuss different ways to get distinct property values in javascript’s …
JavaScript: Add Year to a Date
Date() constructor creates different date values. At the same time, while we are working with dates, we often need to process the dates by adding a year or some years to them. This article will discuss different ways to add years to a javascript date. Add Year to a Date Value by Accessing Properties of …
JavaScript: Add Month to a Date
Date() constructor creates different date values. While working with dates in JavaScript, we often need to change the dates, like adding months to date before processing it. This article will discuss different ways to add months to a javascript date. Add Months to a Date Value by Accessing Properties of a Date Javascript’s getFullYear() will …
JavaScript: Add Days to a Date
While working with dates in JavaScript, we often need to change the dates, like adding or subtracting days to date before processing it. While adding days to a date, we expect the month and year values to be incremented accordingly depending on the number of days being added. This article will discuss practical ways to …
JavaScript: Convert Milliseconds to Date
While working with dates in JavaScript, we often need to convert milliseconds to a date value as we need to process them. This article will write functions to convert timestamps to human dates. Convert Milliseconds to a Date Value using toDateString() Javascript’stoDateString() method will return the portion of Date in English in the format: First …