-
-
Save Shestac92/8729cdc1f6fee212ea5419ce2806e155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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