I am adding elements to an array like this..
myarray = [];
myarray.push($('#name1').text());
myarray.push($('#name2').text());
myarray.push($('#name3').text());
myarray.push($('#name4').text());
This is working correctly, but i am trying to only push to the array if the element exists and has content.
I know I can go through the array afterwards and strip out any empty values but is there a way I can do it first to save having that extra step?