javascript

javascript

How to add elements to the start of JavaScript arrays by using unshift

This post will show you how to add elements to the start of an array by using the unshift method. unshift can be used to add single or multiple elements to the front of an array in JavaScript.

Read
javascript

How to reverse an array in JavaScript in place

Learn how to reverse an array in JavaScript in place by using the Array.reverse() method. The reverse() method reverse the content of an array in place.

Read
javascript

JavaScript reduceRight() method explanation with examples

Learn how to use reduceRight method of JavaScript to get a single result by applying an accumulator from right to left of an array. We will learn how to use reduceRight with an array function, callback function or a callback reducer function.

Read
javascript

How to merge arrays in JavaScript using concat() method

Learn how to merge arrays in JavaScript by using concat() method. The concat method is used to merge two or more arrays in JavaScript.

Read
javascript

JavaScript array fill method explanation with examples

JavaScript array fill() method explanation with examples. The fill method can be used to change the contents of a n array to a static value. In this post, we will learn how to use the fill() method with examples.

Read
javascript

JavaScript program to add padding to the start of a string

JavaScript program to add paddings to the start of a string by using padStart. We can use padStart method to add start padding to strings with any character.

Read
javascript

How to check if a string ends with another string or character in JavaScript

JavaScript program to check if a string ends with another string or not. We will use the endsWith method to check it. This post will show you how to use endsWith with character or string.

Read
javascript

How to use the substring method in JavaScript string

JavaScript string substring method can be used to get a part of a string in between two indexes of a given string. This post will show you how to use the substring method with examples.

Read
javascript

How to use JavaScript string lastIndexOf method

JavaScript string lastIndexOf method explanation with example. The lastIndexOf method is used to search the position of a specific character or a sub string in a given string.

Read
javascript

4 ways in JavaScript to check if the first character of a string is in upper case

JavaScript program to check if the first character of a string is in upper case or not. We will learn 4 different ways to do this in this post.

Read