Splice方法:
function trimSpace(array){ for(var i = 0 ;i<array.length;i++) { if(array[i] == " " || array[i] == null || typeof(array[i]) == "undefined") { array.splice(i,1); i= i-1; } } return array; }
原文地址:https://www.cnblogs.com/wangshengli520/p/11097443.html
时间: 2024-10-10 06:51:57