Skip to content Skip to sidebar Skip to footer
Showing posts with the label Template Literals

Javascript Es6 Tagged Templates - When Is Raw Used? When Is Cooked Used?

After studying this Es6 tag template example: var yo = func`${x} + ${y}\n= ${x + y}`; one@public-… Read more Javascript Es6 Tagged Templates - When Is Raw Used? When Is Cooked Used?

Why Can't String.raw End With A Backslash?

String.raw can be used to create a string that contains backslashes, without having to double up th… Read more Why Can't String.raw End With A Backslash?

Is There A Downside To Using Es6 Template Literals Syntax Without A Templated Expression?

Is there a reason (performance or other) not to use backtick template literal syntax for all string… Read more Is There A Downside To Using Es6 Template Literals Syntax Without A Templated Expression?

Are Javascript Template Literals Guaranteed To Call Tostring()?

const num = 42 const str = `My number is ${num}` In this code what guarantee do I have about the c… Read more Are Javascript Template Literals Guaranteed To Call Tostring()?

How Would You Turn A Javascript Variable Into A Template Literal?

I would like to take text that I generated and stored in a string and use it like a template litera… Read more How Would You Turn A Javascript Variable Into A Template Literal?