I have this function and this for.. of
but I can not get the days to be capitalized by console.
What's wrong ???
Array.prototype.toUpperCase = function() {
for (let i = 0; i < days.length; i++) {
days[i] = days[i].charAt(0).toUpperCase() + days[i].substr(1);
}
};
const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
for (const day of days) {
console.log(day);
}