JavaScript String functions trimStart() & trimEnd() #javascript #shorts

1 year ago
1

Hi Friends,

JavaScript String functions trimStart() & trimEnd()

`trimStart()` & `trimEnd()` removed whitespace characters from start & end of a string respectively. These are also known as `trimLeft()` & `trimRight()` too.

let str = " Hey, there! ";
console.log(str.trimStart()); // "Hey, there! "
console.log(str.trimEnd()); // " Hey, there!"

#javascript #string #javascriptstring #javascriptlearning #javascriptinterview #javascriptstringfunctions #stringfunctions #stringtrimmer #trimStart #trimEnd #trimleft #trimright #interview #interviewquestionsandanswers #question #answer #questionanswer #questionandanswer #shorts #trending #trend #popular #princecheema_official @princecheema_official

Loading comments...