Open ryk072018 opened 3 years ago
const str = 'sky so beautiful '
const newStr = str.split(' ').join('')
console.log(newStr)
考点:split() 和 join() 方法 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/split https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/join
问题来源: https://github.com/haizlin/fe-interview/issues/6
https://github.com/haizlin/fe-interview/blob/master/category/js.md
const str = 'sky so beautiful '
const newStr = str.split(' ').join('')
console.log(newStr)