for (var i = 0; i < 7; i++) {
var _name = moment().subtract('days', i).format('dddd');
week_count.push({
_name: 0
});
}
This is what I am attempting to do - however, this creates a list of objects that have properties named _name
, how can I go about doing this? I tried executing it like so { moment().subtract('days',i).format('dddd') : 0 }
, but this gave in to a Syntax Error. How do I go about achieving this?