Answers for "convert integer month to string month react native"

0

convert integer month to string month react native

var label = [{month: 9, revenue: 400}, 
            {month: 11, revenue: 500},
            {month: 12, revenue: 600}]

var months = [];
var revenue = [];
var m = [ "January", "February", "March", "April", "May", "June", 
           "July", "August", "September", "October", "November", "December" ];

label.forEach(function(value){
    var monthName = m[value.month - 1];
    months.push(monthName);
    revenue.push(value.revenue);
});

console.log('Months Array: ', months);
console.log('Revenue Array:', revenue);
Posted by: Guest on October-31-2020

Code answers related to "convert integer month to string month react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language