Empty Objects need to be individually created before their values are assigned. And use of const is not a good idea here, anyway, it’s just my suggestion.
const birthdays = {};
var day = 123;
var id = 21;
var birthday = 2016;
// Loop -> Passing day, id and birthday
birthdays[day] = {};
birthdays[day][id] = birthday;