(第二天)[js] 写一个方法去掉字符串中的空格

 写一个方法去掉字符串中的空格,要求传入不同的类型分别能去掉前、后、前后、中间的空格

  

var str = ' 1 2 3445 6    ';
console.log(str.split(' ').join(''))
原文地址:https://www.cnblogs.com/DIVEY/p/15165023.html