Check string is date or not in JavaScript
To check a string value is a date, there are many ways to do that. But problem occur when string is a number, since a number can be converted into…
To check a string value is a date, there are many ways to do that. But problem occur when string is a number, since a number can be converted into…
Let say we have an array of object which and object contain age and name. Now we want to find out youngest person and elder person. For these we have…
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…
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…