TG Telegram Group & Channel
JavaScript | United States America (US)
Create: Update:

CHALLENGE

const templateFn = (strings, ...values) => {
return strings.reduce((result, str, i) => {
const value = values[i] !== undefined ?
(typeof values[i] === 'number' ? values[i] * 2 : values[i]) : '';
return result + str + value;
}, '');
};

const num = 5;
const str = 'world';

const result = templateFn`Hello ${str}, ${num} times ${'!'}`;
console.log(result);

CHALLENGE

const templateFn = (strings, ...values) => {
return strings.reduce((result, str, i) => {
const value = values[i] !== undefined ?
(typeof values[i] === 'number' ? values[i] * 2 : values[i]) : '';
return result + str + value;
}, '');
};

const num = 5;
const str = 'world';

const result = templateFn`Hello ${str}, ${num} times ${'!'}`;
console.log(result);


>>Click here to continue<<

JavaScript




Share with your best friend
VIEW MORE

United States America Popular Telegram Group (US)