Difference between the substr() and substring() in JavaScript?

Difference between the substr() and substring() in JavaScript?

In this article, We’ll see what’s the difference between substr and substring in javascript The substr() method extracts parts of a string, beginning at the character at the specified position, and returns the specified number of characters. The substring() method returns the part of the string between the start and end indexes, or to theRead more about Difference between the substr() and substring() in JavaScript?[…]

How to remove a particular element from an array in javascript?

How to remove a particular element from an array in javascript?

In this article, We’ll see how to remove a particular element from an array in javascript? let’s create a employee‘s array as follows: if we want to remove the value “Alex” from an employee’s array. what will do ? We can use filter method to remove the value “Alex” from an array. That’s it!. PleaseRead more about How to remove a particular element from an array in javascript?[…]

How to remove a property from object in javascript?

How to remove a property from object in javascript?

In this article, We’ll see how to remove a property from a javascript object? let’s create a employee object as follows: if we want to remove the property “address” from employee object. what will do ? We’ll use delete keyword to remove the property from object. That’s it!. Please share your thoughts or suggestions inRead more about How to remove a property from object in javascript?[…]

How to remove duplicate elements from an array in javascript?

How to remove duplicate elements from an array in javascript?

In this article, We’ll see how to remove a duplicate element from an array in javascript? In ES6, we’ll use new Set data structure to remove a duplicate elements from an array. Befor using the new Set data structure, we’ll read about its decription. Set objects are collections of values. You can iterate through theRead more about How to remove duplicate elements from an array in javascript?[…]

How to check whether a string contains a substring in javascript ?

How to check whether a string contains a substring in javascript ?

In this article, We’ll see how to check a string contains a substring in javascript? In ES6, we’ll use String.prototype.includes to find a substring in a string The includes() method determines whether one string may be found within another string, returning true or false as appropriate. Below an example using ES6 to find string containsRead more about How to check whether a string contains a substring in javascript ?[…]

How to check a key exist or not in json object ?

How to check a key exist or not in json object ?

In this article, We’ll see how to check a key exist or not in json? before see the example, we’ll read about hasOwnProperty method and why we use hasOwnProperty method. hasOwnProperty() method returns a boolean indicating whether the object has the specified property as its own property (as opposed to inheriting it). To check theRead more about How to check a key exist or not in json object ?[…]