padStart and padEnd methods | String Object In JavaScript

🔹🎁 Join my channel to get access to perks:

🧡 Hello All JavaScript Lovers Outhere!

Today you’re going to learn about the String Object In JavaScript.

This tutorial is a series of videos, in each video we will discuss a method (or more) of the String Object in JavaScript.

In today’s video, you’re going to learn about the padStart, and padEnd methods.

The padStart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length. The padding is applied from the start of the current string.

The padEnd() method pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end of the current string.

🟢🟠 The string.padStart() and string.padEnd().
🔷 Syntax :
padStart(targetLength, padString)

padEnd(targetLength, padString)

🔹targetLength : The length of the resulting string once the current str has been padded. If the value is less than str.length, then str is returned as-is.
🔹padString : The string to pad the current str with. If padString is too long to stay within the targetLength, it will be truncated from the end. The default value is the unicode “space” character (U+0020).

🌍 Social Media Links.
◾ Facebook :
◾ Twitter :
◾ Instagram :
◾ GitHub :

💲 Suppport the Channel
Paypal :
Buy Me a Coffee:

JavaScript For Beginners

JavaScript for beginner|JavaScript for beginner

JavaScript For Beginners

If you’re looking for a great course on programming in JavaScript, look no further. JavaScript is fast becoming one of the fastest growing programming languages in the world, and it’s gaining popularity as a result. JavaScript can be used to build a wide variety of applications, from web and mobile applications to real-time networking and command-line tools. It’s also widely used in games. JavaScript for Beginners will teach you the basics and introduce you to the language’s many applications.

You May Also Like