function myTrim(str){ const reg = /\s+/g return str.replace(reg,"") } console.log(myTrim(" 233 ").length)