我在 javascript 中有一个代码块,它从 API(此数据的真实来源)中获取一组项目,并且当数组中每个对象的更新日期发生时,它应该更新我的发电机数据库中的数据与我所拥有的不符。对我来说一切都很好,但我总是说即使我已经验证了更新存在,也不需要更新任何内容。不太确定我在这里做错了什么。
let count = 0;
for (let appToCompare of arrayOfFormattedApps) {
let hasMatch = false;
for (let index = 1; index < currentCachedListOfApps.length; ++index) {
var cachedApp = currentCachedListOfApps[index];
if (cachedApp.ApplicationId === appToCompare.ApplicationId) {
if (cachedApp.LastUpdateDateTime !== appToCompare.LastUpdateDateTime) {
arrayOfAppsWithUpdates.push(appToCompare);
hasMatch = true;
console.log(cachedApp.AppName + ' is being updated')
++count;
break;
}
}
}
if (hasMatch) {
arrayOfAppsWithUpdates.push(appToCompare);
}
}
哈士奇WWW
DIEA
慕姐8265434
相关分类