Javascript Array filter not filtering

前端 未结 2 908
有刺的猬
有刺的猬 2021-01-26 05:53

I cannot get Javascript to filter a dynamically created array, although it filters a static array fine. Code block #1 works (static array), code block #2 doesn\'t (dynamically

2条回答
  •  情书的邮戳
    2021-01-26 06:11

    Or, we can actually do

    Array.prototype.filter.call(_eventsArray, function(_calendarEvent) { return _calendarEvent.unit == _unitValue; });

提交回复
热议问题