function tag(strings, ...values) {
return strings.reduce((acc, str, i) => {
return acc + str + (values[i] ? values[i].toUpperCase() : '');
}, '');
}
const first = "hello";
const second = "world";
const result = tag`${first} and ${second} are great!`;
console.log(result);Ответ: HELLO and WORLD are great!
JavaScript test | #JavaScript