我有一个称为mainDateArray的本地日期数组,我曾经调用过APi Calls进行响应,从响应中我得到了两个分别称为“ Dates”和“ RecordCount”的数组。此日期和记录计数具有相同的长度,并且recordCount数组包含与服务器中“日期”相对应的值。
稍后,如果日期数组值与mainDateArray不匹配,我需要基于这两个“ mainDateArray”和“ recordCount”绘制图形,我需要在“ recordsCount”数组上附加或推入0
更清楚一点
mainDateArray = ["05-May-19","06-May-19","07-May-19","08-May-19","09-May-19","10-May-19","11-May-19"];
dates = ["06-May-19","08-May-19","10-May-19"]; // response date
recordsCount = [20,30,10]; // data for the above dates Array from response
我的预期输出
op = [0,20,0,30,0,10,0];
example:=> ["05-May-19"=0,"06-May-19"=20,"07-May-19"=0,"08-May-19"=30,"09-May-19"=0,"10-May-19"=10,"11-May-19"=10]
即,当我的响应日期不包括maindateArray时,我需要在recordCount数据中附加0,任何帮助都会对我有帮助
湖上湖
FFIVE
肥皂起泡泡
相关分类