@sdetweil
It now works, I can get data into my new object.
My new json file look like this:
{
"RecyclingDates": [
{ "Type": "House", "Date": "02.01.2021"},
{ "Type": "House", "Date": "08.01.2021"},
{ "Type": "House", "Date": "15.01.2021"},
{ "Type": "Glass", "Date": "22.01.2021"},
{ "Type": "Glass", "Date": "29.01.2021"},
{ "Type": "Glass", "Date": "05.02.2021"},
{ "Type": "Garden", "Date": "12.02.2021"},
{ "Type": "Garden", "Date": "19.02.2021"},
{ "Type": "Garden", "Date": "26.02.2021"},
{ "Type": "Garden", "Date": "05.03.2021"},
{ "Type": "Big", "Date": "12.03.2021"},
{ "Type": "Big", "Date": "19.03.2021"},
{ "Type": "Big", "Date": "26.03.2021"}
]
}
I get this object output:
Object
RecyclingDates: Array(13)
0:
Type: "House"
Date: "02.01.2021"
__proto__: Object
1:
Type: "House"
Date: "08.01.2021"
__proto__: Object
2: {Type: "House", Date: "15.01.2021"}
3: {Type: "Glass", Date: "22.01.2021"}
4: {Type: "Glass", Date: "29.01.2021"}
5: {Type: "Glass", Date: "05.02.2021"}
6: {Type: "Garden", Date: "12.02.2021"}
7: {Type: "Garden", Date: "19.02.2021"}
8: {Type: "Garden", Date: "26.02.2021"}
9: {Type: "Garden", Date: "05.03.2021"}
10: {Type: "Big", Date: "12.03.2021"}
11: {Type: "Big", Date: "19.03.2021"}
12: {Type: "Big", Date: "26.03.2021"}
length: 13
I opend “0” and “1” in the object, so you can see how its stored in the object.
How do I access these values in my module.js file. I hope to make a loop/compare of the array.
My plan is to show different pictures according to the Type and if the Date is equale to current date.