I have a very simple problem but for some reason I can't find the answer for it.
label.forEach(function(value){
months.push(value['month']);
revenue.push(value['revenue']);
});
The label
is an array of numbers and revenue, in my case this is
[
{month: 9, revenue: 400},
{month: 11, revenue: 500},
{month: 12, revenue: 600}
]
This is a forEach loop in javascript, it pushes revenue and a month number into two seperate arrays, the problem is that the month is a number (e.g. 12) but I want the .push() to push a month name instead (December), I can't seem to find anything so I was hoping anyone here could help me out.