I have a date array as below:
const d = ["2020-06-29T00:00:00.000Z","2020-07-06T00:00:00.000Z","2020-07-13T00:00:00.000Z","2020-07-20T00:00:00.000Z","2020-07-27T00:00:00.000Z"];
I want to shift every element in the date array into two weeks earlier from the date using forEach below from the method I found here how do I subtract one week from this date in jquery?
d.forEach(d.setDate(d.getdate() - 14));
However, I receive error while what I want is all date has shifted into two weeks earlier as below:
const d = ["2020-06-15T00:00:00.000Z","2020-06-22T00:00:00.000Z","2020-06-29T00:00:00.000Z","2020-07-13T00:00:00.000Z","2020-07-20T00:00:00.000Z"];