js foreach map filter some 兼容底层实现写法