Help with Map Method JavaScript

Can someone please explain to me what the (c) is valued for here and how its working?

.map((c) => c.toUpperCase());

I found this after searching for ways to target an array, and convert its “string” items to all uppercase caps in a new array. Im so new to this and .map and genuinely have no idea. Thank you in advanced.
My example:

var alphabetLowercase = “abcdefghijklmnopqrstuvwxyz”.split(‘’);
var alphabetUppercase = alphabetLowercase.map((c) => c.toUpperCase());

In your example, c is the current value of the array as it is mapped over.

Try running this:

const myArr = ['a', 'b', 'c'];
const myCapArr = myArr.map((c) => {
    console.log(c);
    return c.toUpperCase();
}
console.log(myCapArr);

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.