JSFiddle - React, Tailwind, and code Playground

by Ishank Dubey

JavaScript

let aVar = `abc
def`;
console.log(aVar);

let message = tag`Hello world`;
console.log(message);
function tag(literal, ...substitutes){
   let str = "";
   for(let i=0;i<substitutes.length;i++){
      str += literal[i];
      str += substitutes[i];
   }
   str += literal[literal.length-1];
   return str;
}