Test boolean truthness of string directly, use 'map' not 'each'.

Since only the empty string returns false, the test for nonzero length can be expressed as a direct boolean check. Also replaced 'each' call with 'map', which removes an unused variable in the processing function.