Cached length on map and filter

Cached the length of the array like other methods for slight performance gain