我有过滤结果的功能
这是代码
filtered = markers.filter(function (marker) {
var getDate = marker.date.match(/\d/g).join('');
var markerDate = new Date(parseFloat(getDate));
return (markerDate => valDateStart && markerDate <= valDateEnd && (marker.imei === imei || imei === null));
});
它是从
重构的 $.each(markers, function (i,marker) {
var getDate = marker.date.match(/\d/g).join('');
var markerDate = new Date(parseFloat(getDate));
// var valDate = new Date(startValue[2], startValue[1] - 1, startValue[0]);
if (markerDate => valDateStart && markerDate <= valDateEnd && (marker.imei === imei || imei === null)) {
filtered.push(marker);
}
});
但现在这一行var markerDate = new Date(parseFloat(getDate));
我有markerDate is never used
问题在哪里?