W
Size: a a a
W
VB
IS
IS
ЕР
{
const name = 'vasya';
const greetingUser = username => `Privet, ${username}`;
const capitalizeString = str => `${str[0].toUpperCase()}${str.slice(1)}`;
console.log(
greetingUser(capitalizeString(name))
);
IS
IS
element.style.background = "...";
W
{
W
ЕР
W
W
IS
{
const name = 'vasya';
const greetingUser = username => `Privet, ${username}`;
const capitalizeString = str => `${str[0].toUpperCase()}${str.slice(1)}`;
const useStringWithCallback = (string, callback) => {
if (typeof callback !== 'function') throw 'Function expected';
return callback(string)
}
const greetingCapitalized = (name, fn) => useStringWithCallback(fn(name), capitalizeString)
console.log(
greetingCapitalized(name, greetingUser)
);
{
W