In this string
${string.toDateString()} - ${string2.toDateString()}
what do $ and ` mean?
In this string
${string.toDateString()} - ${string2.toDateString()}
what do $ and ` mean?
These are called Template Literals in Javascript.
A Template Literal is enclosed in back-ticks instead of single quotes or double quotes. The ${}
notation allows you to embed the string value of an enclosed variable or expression.
Read additional information about Javascript Template Literals here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals