undefined

Filtering undefined or empty strings from array of objects in Javascript

我与影子孤独终老i 提交于 2021-01-06 02:46:49
问题 So I am having trouble creating a function that will filter and sort dates and its data to be placed in an array of objects. The issue I am having is a different but similar scenario. The original question was taken from here: Filtering undefined from array of objects in Javascript Lets say that var arrObject has more than 2 items in an array. See code below.I want to filter any empty string or undefined values and with any items in the array and sort then asc. order by dates. In the new