i have got an response with number of values with same month.
If you can see the left one (TAR_HEF_01,TAR_HEF_02...)are the months and right one are the values for the same.
in this each month (lets say TAR_HEF_01) contain 4 values.
i have 6 months in a array.i have got monthIndexValue through loop like below.
hebrewMonthArray.forEach((monthValue, index) => {
let monthIndex = hebrewMonthArray.indexOf(hebrewMonthArray[index]);
monthIndexValue =
monthIndex < 9
? `TAR_HEF_0${monthIndex + 1}`
: `TAR_HEF_${monthIndex + 1}`;
i have got value like below
Object.keys(allWorkDetails).forEach((work, index) => {
let value = allWorkDetails[work][monthIndexValue][0] || 0;
});
});
**Here is the console of monthIndexValue and value **:---
TAR_HEF_01 0
TAR_HEF_01 0
TAR_HEF_01 0
TAR_HEF_01 0
TAR_HEF_02 0
TAR_HEF_02 0
TAR_HEF_02 0
TAR_HEF_02 0
TAR_HEF_03 0
TAR_HEF_03 0
TAR_HEF_03 0
TAR_HEF_03 0
TAR_HEF_04 0
TAR_HEF_04 0
TAR_HEF_04 0
TAR_HEF_04 0
TAR_HEF_05 0
TAR_HEF_05 0
TAR_HEF_05 0
TAR_HEF_05 0
TAR_HEF_06 90
TAR_HEF_06 9
TAR_HEF_06 -200.8
TAR_HEF_06 214.9
i want to create one array for each month contain their values.
if i will put console(monthIndexValue,arrayOfValue);
the output should be:---
TAR_HEF_01 [0,0,0,0]
TAR_HEF_02 [0,0,0,0]
TAR_HEF_03 [0,0,0,0]
TAR_HEF_04 [0,0,0,0]
TAR_HEF_05 [0,0,0,0]
TAR_HEF_06 [90,9,-200.8,214.9]
How can i solve? Thanks...