Tag Template Literal
function modifier(strings, ...value) {
const mr = strings.reduce((prev, current) => {
return prev + current + (value.length ? 'Mr.' + value.shift() : "");
}, "");
return mr
}
let a = 'Sakib';
let b = 'Tamim';
console.log(modifier`We have ${a} And ${b} in our Crecket Time.`);
Comments
Post a Comment