<div class="codetitle"> <span><a style="CURSOR: pointer" data="49796" class="copybut" id="copybut49796" onclick="doCopy('code49796')"><u>複製程式碼</u></a></span>如下程式碼:</div> <div class="codebody" id="code49796"> <br>function ClearNullArr(arr){ <br>for(var i=0 ,len=arr.length;i<len>if(!arr[i]||arr[i]==''||arr[i] === undefined){ <br>arr .splice(i,1); <br>len--; <br>我--; <br>} <br>} <br>回傳arr; <br>} <br></len> </div>