You may use filter
:
var newArray = oldArray.filter(function(v){return v!==''});
The MDN has a workaround for IE8 compatibility. You might also use a good old loop if you're not going to use filter
anywhere else, there's no problem with looping...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…