So this seem to be the correct solution:
const toLowerCase = (s) => {
return s.toLowerCase();
}
const toUpperCase = (s) => {
return s.toUpperCase();
}
export const createSamples = (s) => {
return s.toLowerCase() + s.toUpperCase();
}
I don't understand why we need to "repeat" s.toLowerCase() and s.toUpperCase() in the constant createSamples, when we defined two constants before (const toLowerCase and const toUpperCase)? Shouldn't const createSamples look like this:
export const createSamples = (s) => {
return toLowerCase + toUpperCase;
}
and let these constants do their job inside const createSamples? Or in other words, why would it be necessary to define const toLowerCase and const toUpperCase first, if we will use s.toLowerCase() + s.toUpperCase() later anyway?