I will do my best to word this correctly - thanks for any help.
I have an array with a series of postcodes in them, (six for example) one of which will be empty. Using javascripts filter function, I removed the element that was empty using the following code:
var filteredrad = radius1.filter(function(val) {
return !(val === "" || typeof val == "undefined" || val === null);
});
Now I need to somehow store the index of which element(s) were removed from the original array, but im unsure on how to.
As an example, the filter would remove the space at index 1. How do I save that number one for use later on?
["WC1A 1EA", "", "B68 9RT", "WS13 6LR", "BN21TW", "wv6 9ex"]
Hope that makes sense, any help would be greatly appreciated.
Ashley
radius1.filter(function(val, index)