Can you use "filter" on an array with esri javascript 3.5 api

Discussion created by LuciH on Sep 3, 2013
Latest reply on Sep 4, 2013 by jacobsj
We are using the javascript version for Arcgis 10.1 "Public Notification" template with our data and would like filter out "null" or empty data responses when it gathers the field data for the Avery labels or the CSV output file.  I attempted to use some code and it either gives me an "undefined" error in a dialog box when I select avery label or "strCsvParam.filter is not a function" error in a dialog box when I select CSV format. 

The main problem is that we have parcels that have "Owner Name", "Address1", "Address2", "Address3", "City", "State", "Zip" for fields.  Not all of the parcels with have any data in "Address2" or "Address3" which leaves blank lines between "Address1" and "City, State, Zip" on the avery label.

I just want to remove the null or empty data from the array.

This is the code that I have tried to remove the empty fields:

strAveryParam = strAveryParam.filter(function(){return true; });

Any advice on how to remove empty, null or false values from an array?