convert integer month to string month react native

Solutions on MaxInterview for convert integer month to string month react native by the best coders in the world

showing results for - "convert integer month to string month react native"
Mariangel
02 Apr 2019
1var label = [{month: 9, revenue: 400}, 
2            {month: 11, revenue: 500},
3            {month: 12, revenue: 600}]
4
5var months = [];
6var revenue = [];
7var m = [ "January", "February", "March", "April", "May", "June", 
8           "July", "August", "September", "October", "November", "December" ];
9
10label.forEach(function(value){
11    var monthName = m[value.month - 1];
12    months.push(monthName);
13    revenue.push(value.revenue);
14});
15
16console.log('Months Array: ', months);
17console.log('Revenue Array:', revenue);