Remove commas from string – Javascript
Let’s look at how you can achieve that! Well to be honest there isn’t much to it we will just use replaceAll. And there you go, could not be easier!
Let’s look at how you can achieve that! Well to be honest there isn’t much to it we will just use replaceAll. And there you go, could not be easier!
In this brief explanation, we will learn how to remove the last digit by using basic math So the first and only step is to divide a number by 10 stripped is now 11.There you go, job done In case you have a string we will add parseInt And there you go, could not be …
Javascript – remove the last digit from a number Read More »
Kompot 1. method: setDate First, let’s initiate the date and assign it to the “yesterday” variable Next, we will use setDate to set it to yesterday’s date. And now, yesterday’s variable has yesterday’s date.Easy as that! 2. method: Quick and Easy oneliner The first and only step is to initialize the Date with today’s date …
Let’s learn how you can check if a key exists in two different waysBoth are very easy. Firstly let’s define our object 1. in Operator just type the key in a string and use “in” with an object 2. hasOwnProperty Here we will use the dedicated function hasOwnProperty() And there you go, that’s how you …
how to check if key exists in an object (Javascript) Read More »
In this very short article, we will learn how to check if the string is uppercase. Let’s start with the very obvious and easy method by creating a function for it. And we will just compare the string with string .upperCase (will take a string and make it uppercase) and return the boolean or a …
In this concise article, we will learn how to remove emojis from a string by using the power of regex. Firstly let’s define a method. then let’s return the string after running it through the .replace function. .Replace function will take two variables. First will be your regex or simple string and the second will …