I want to refactor this code in a nicer way without exceeding an 80 char line limit.
document.getElementById('latest-date').innerHTML =
(
days[date.getDay() -1] + ' ' + date.getDate() + ' ' +
months[date.getMonth()] + ', ' + date.getFullYear() + ' - ' +
date.getHours() + ':' + date.getMinutes()
);
I wanted to use Template Literals but I think when I go to newline in order to follow char limit it will automatically add \n
?
An example of the output of the current code is :
Thur 24 Aug, 2017 - 18:30