Use 1
It's multiline. (In JS, norm strings need backslashes before newline chars.)
Use 2
An alternative style. Compare:
a: ${a}, b: ${b}, c: ${c}, d: ${d}, e: ${e}
.with:
a: '+a+', b: '+b+', c: '+c+', d: '+d+', e: '+e
.And compare:
function generated_function(){
'+ statement1 +'
'+ function2_name +'();
f3();
f'+ 5*5 +'();
}
.with:
function generated_function(){
${statement1}
${function2_name}();
f3();
f${ 5*5 }();
}
Nicety
It's backslash-escaped too—<${> by <\${> or <$\{>.
Nb
It's different to <String.raw>. Cf
§.