I'm simply getting the 3 future days from an array of objects based on the current day to display for a weather component.
This is the first time I've attempted using ES6 and it's features so please take this into consideration.
Is there a better way to do this and save the values? Have I overcomplicated the whole thing?
const days = [
{0: 'Sun'},
{1: 'Mon'},
{2: 'Tue'},
{3: 'Wed'},
{4: 'Thu'},
{5: 'Fri'},
{6: 'Sat'}
];
let currentDay = new Date(Date.now()).getDay();
const offset = currentDay + 1;
const daysLength = days.length;
let counter = 0;
let newDays = [];
for (const [i, day] of days.entries()) {
// set the index start point.
let pointer = (i + offset) % daysLength;
newDays.push(days[pointer][pointer]);
counter++
if (counter === 3) { break; }
}