I know in PHP we can do something like this:
$hello = \"foo\"; $my_string = \"I pity the $hello\";
Output: \"I pity the foo\"<
\"I pity the foo\"
Create a method similar to String.format() of Java
String.format()
StringJoin=(s, r=[])=>{ r.map((v,i)=>{ s = s.replace('%'+(i+1),v) }) return s }
use
console.log(StringJoin('I can %1 a %2',['create','method'])) //output: 'I can create a method'