Slide 53
Slide 53 text
Tagged Templates
Dominik Kundel | @dkundel | #jsconfus | #makeWebNotWar
function scream(strings, !!...values) {
return strings.reduce((output, currentString, idx) !=> {
return (
output + currentString + (values[idx] !|| '').toString().toUpperCase()
);
}, '');
}
const eventName = 'jsconf us';
scream`Hello Everyone. Welcome to ${eventName}!`
!// !!==> "Hello Everyone. Welcome to JSCONF US!"