fueanta

Tagged Template Literal in JS

Mar 26th, 2020
155
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const tag = (strings, ...values) => {
  2.     console.log(strings)
  3.     console.log(values)
  4. }
  5.  
  6. let val1 = "Hello"
  7. let val2 = "World"
  8. let val3 = "!"
  9.  
  10. tag`ABCD${val1}EFGH${val2}IJKL${val3}`
RAW Paste Data