I have this array that needs to be filtered, it consists of many objects, was using a loop, it's effective but really slows my apps down I'll simplify my array.
let arrayToFilter = [{id:1,month:'Dec'},{id:2,month:'Nov'},{id:3,month:'Feb'},{id:4,month:'Nov'},{id:5,month:'Jan'}]
let filter = ['Dec','Nov']
without looping (for var i =0 ..... ) how to only show data of array with month Dec & Nov? or using a filter. from JavaScript? I need it to be fast (not slowing down my apps), efficient, and effective.
Thanks before
I would use a
Setfor the filter due to itsO(1)time complexityFor example