toUpperCase
trim
trimEnd
先頭と末尾の空白を削除します。
str.trim()
下記の値を入力するとサンプルに即時反映されます。
const
console
const text = " hello world "; console.log(text.trim()); // "hello world"