I have stumbled on a weird issue when trying to recursively set properties on an empty object with the following code:
Simplified code
const birthdays = {};
// Loop -> Passing day, id and birthday
birthdays[day] = day;
birthdays[day][id] = birthday;
Example of day: '01012017'
Example of id: 1547
Example of birthday: {name: John}
Error message
Cannot create property '123' on string '06012017'
I saw some people with Angular having this issue but their answer don't solve anything for me (as is angular specific syntax etc).