@Mick-2097Submitted over 2 years ago
I was trying to come up with a way to forEach the buttons and use each buttons classList.value as the template string filler for innerText.current and .previous, eg. JS15(data[i]).timeframes.(classList.value).current), thinking I could eliminate the if statements and get DRY, but then daily and monthly previous would say 'Last week - '. So I figured I'd stick with what I've done.
If that makes sense to anyone else and there is a way to do it without each previous value including 'Last week - ', please let me know. Cheers!!