Skip to content

Instantly share code, notes, and snippets.

@Shestac92
Created March 23, 2019 08:26
Show Gist options
  • Save Shestac92/8729cdc1f6fee212ea5419ce2806e155 to your computer and use it in GitHub Desktop.
Save Shestac92/8729cdc1f6fee212ea5419ce2806e155 to your computer and use it in GitHub Desktop.
function createProcessor(strings, ...args) {
return function(...symbols){
return args.map(i => `${strings[i]}${symbols[i] || ' '}`).join('');
};
}
const processor = createProcessor`this${0}is${1}fucking${2}awesome${3}`;
console.log(processor(' q ', ' w ', ' e ', ' r '));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment