Try this using jQuery:
var arr = ["Jan 2011", "Feb 2011", "Mar 2011"];
var name = ["JANUARY", "FEBRUARY", "MARCH"];
var list = new Array();
// Loop through the array arr
$.each(arr, function(i, value) {
// Convert the month names
var month = name[i];
var year = value.split(" ")[1];
// Display the result
alert(month + ' ' + year);
// Add elements to a new array
list.push(month + ' ' + year);
});
console.log(list);
Console Result:
["JANUARY 2011", "FEBRUARY 2011", "MARCH 2011"]
Hope this helps!
Try this using jQuery:
var arr = ["Jan 2011", "Feb 2011", "Mar 2011"];
var name = ["JANUARY", "FEBRUARY", "MARCH"];
// Loop through the array arr
$.each(arr, function(i, value) {
// Convert the month names
var month = name[i];
var year = value.split(" ")[1];
// Display the result
alert(month + ' ' + year);
});
Hope this helps!
Try this using jQuery:
var arr = ["Jan 2011", "Feb 2011", "Mar 2011"];
var name = ["JANUARY", "FEBRUARY", "MARCH"];
var list = new Array();
// Loop through the array arr
$.each(arr, function(i, value) {
// Convert the month names
var month = name[i];
var year = value.split(" ")[1];
// Display the result
alert(month + ' ' + year);
// Add elements to a new array
list.push(month + ' ' + year);
});
console.log(list);
Console Result:
["JANUARY 2011", "FEBRUARY 2011", "MARCH 2011"]
Hope this helps!
Try this using jQuery:
var arr = ["Jan 2011", "Feb 2011", "Mar 2011"];
var name = ["JANUARY", "FEBRUARY", "MARCH"];
// Loop through the array arr
$.each(arr, function(i, value) {
// Convert the month names
var month = name[i];
var year = value.split(" ")[1];
// Display the result
alert(month + ' ' + year);
});
Hope this helps!
lang-js