Map Filter Reduce Foreach Javascript Break