toUpperCase
trim
trimEnd
Removes whitespace from both ends of a string.
str.trim()
Enter values below to update the example in real time.
const
console
const text = " hello world "; console.log(text.trim()); // "hello world"