Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
One-liner solution in Clear category for [old] Even the Last by Goodester
function evenLast(data) {
return (data[data.length - 1] || 0) *
data.reduce((total, currentValue, currentIndex) => currentIndex % 2 == 0 ? currentValue + total : total, 0);
}
July 30, 2019