Programming Tips - javaScript: remove entries at the end of an array that are empty

Date: 2008mar14 Language: javaScript Keywords: clean, trim, delete Q. javaScript: remove entries at the end of an array that are empty A. Here is an efficient function that does it:
function removeTrailingEmpty(a) { while (a[a.length - 1] == '') { a.pop(); } return a; }