SHARE
TWEET

Tagged Template Literal in JS

fueanta Mar 26th, 2020 (edited) 65 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top