If more than one parameter in the function definition has the same name, the last occurrence "shadows" the preceding occurrences. A duplicated name might be a typo, and may confuse anyone reading the code.
// Here are two parameters named 'a'
function func(a, b, a) {
console.log("value of the second a:", a);
}
const logger = function (a, b, a) {
console.log("value of the second a:", a);
};
function func(a, b, c) {
console.log(a, b, c);
}
const logger = function (a, b, c) {
console.log(a, b, c);
};