Replace all special character from string in JavaScript
In many places in programming, we want to replace special character with _ or anything else. There are many ways to replace but I am going to use replace function…
In many places in programming, we want to replace special character with _ or anything else. There are many ways to replace but I am going to use replace function…
There are many libraries which we can used to perform this task. But some time we do not want to use library in that case we have to use pure…
Suppose you have one release branch and you have created a feature branch from the release branch. Now you want to update your feature branch with release branch. This is…
Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> Now we have this dataurl…
If we want to remove any key from a given object then we have the following method. 1. Using delete const obj = { a: 1, b: 2, c: 3,…
Many times we need to do Deep copying objects in JavaScript. Since shallow copy may cause many issues as it may affect original object. Here are few ways to achieve…
We can remove element from array with different ways. But if we want to remove specific element from array then we have to think different approach. 1. Using indexOf and…
These are few Javascript Ouput based interview question, which I faced during my interview process. Question 1. console.log('val1--val:',val1); val1 = 10; test(); var val2 = 20; const test = ()…