I ran into a quirk that maybe has some documentation reason behind it, but the code running here adds an undefined entry after the expected result. Any help in this is appreciated. Code:
const decimals = [0.75, 0.91, 0.48, 0.23, 0.99, 0.83, 1.1];
function logPercentages(decimals) {
const percentages = (decimals) => console.log(`${Math.round(decimals*100)}` + "%");
decimals.forEach(percentages);
}
console.log(logPercentages(decimals));
And here is the result of running the code:
75%
91%
48%
23%
99%
83%
110%
undefined
Ideas?