I'm currently attempting to generate an array of months for the current quarter as well as the previous quarter using the code snippet below. I came across some guidance on this page and have been following it.
var dataQuarter = Array.apply(null, Array(3)).map(function (_, i) {
return moment(i, 'e').startOf('quarter').month(i).format('LL');
})
var dataQuarterLast = Array.apply(null, Array(3)).map(function (_, i) {
return moment(i, 'e').startOf('quarter').subtract(1, 'quarter').month(i).format('LL');
})
The content of the arrays generated by this code is not what I expected or desired. If anyone could point me in the right direction, I would greatly appreciate it.
Update:
Upon running console.log on both variables, here are the results:
Array(3) [ "January 1, 2020", "February 1, 2020", "March 1, 2020" ]
Array(3) [ "January 1, 2020", "February 1, 2020", "March 1, 2020" ]