JavaScript String functions padStart() & padEnd() #javascript ( #shorts )

1 year ago
16

Hi Friends,

JavaScript String functions `padStart()` & `padEnd()`

`padStart()` & `padEnd()` functions pad a string with provided character until it reaches a given length.

let str = "Hello";
console.log(str.padStart(10, "x")); // "xxxxHello"

let str = "Hello";
console.log(str.padEnd(10, "x")); // "Helloxxxxx"

#javascript #string #javascriptstring #javascriptlearning #javascriptinterview #javascriptstringfunctions #stringfunctions #stringpadstart #stringpadend #padstart #padend #padstartinterview #padendinterview #startend #start #end #interview #interviewquestionsandanswers #question #answer #questionanswer #questionandanswer #shorts #trending #trend #popular #method #function #shorts #shortsfeed #shortvideo #short #shortsyoutube #shortsviral #viral #viralshort #viralvideo #viralshorts #chatgpt #openai #gpt3 #gpt4 #chatgpt4 #chatgpt3 #princecheema_official @princecheema_official ​

Loading comments...