const newDate = map(items.result, (obj => { if (isDateWithinRage(obj.date_from)) { return { "date": obj.join_date, "name": obj.student.name } } })) The if statement has produced something like this
[Object, Object, Object, Object, Object, undefined, undefined, undefined, undefined, Object, Object, Object] How to fix the undefined part? I want to skip the iteration.