var arr = [];
for(var i=0,flag=true,len=arr.length;i<len;flag ? i++ : i){
console.log(arr[i]);if( arr[i] && arr[i].type == "TXT" && arr[i].text == '' ){
arr.splice(i,1);
flag = false;
} else {
flag = true;
}
}
var arr = [];
for(var i=0,flag=true,len=arr.length;i<len;flag ? i++ : i){
console.log(arr[i]);}