javascript remove spaces at the beginning of the end of the string
const stringWithSpaces = ' I learn JS with Coderslang every day ';
console.log(stringWithSpaces.trimStart()); //'I learn JS with Coderslang every day '
console.log(stringWithSpaces.trimEnd()); //' I learn JS with Coderslang every day'
console.log(stringWithSpaces.trim()); //'I learn JS with Coderslang every day'
Also in JavaScript:
- js date difference in seconds
- moment add 30 days
- react 17 hot reload not working
- javascript function that make a choice
- selection sort javascript
- js nextsibling
- python http request post json example
- iterate through object array javascript
- ngif is string angular
- angular stacked bar
- store console.timeEnd in variable js
- js cleartimeout
- onkeyup in javascript
- tableau js
- update cart quantity javascript
- react toggle state
- jQuery Event Methods
- click outside box jquery
- how to create component in reactjs
- conditionally add key to object javascript
- how to use a function from another file in javascript
- print element by xpath javascript
- find element by object field vuejs
- how to flatten array in javascript using foreach loop