Template Literals
What is the result of `${'a' + 'b'}` in JavaScript?
The result of `${'a' + 'b'}` is 'ab'. Inside the ${} in a template literal, the expression 'a' + 'b' is evaluated first, resulting in the string 'ab'. Then, this result is inserted into the template literal. The expression inside ${} can be any valid JavaScript expression, including string concatenation. In this case, the + operator performs string concatenation of 'a' and 'b' to create 'ab'. Template literals evaluate all expressions inside ${} and convert the results to strings before constructing the final string output. This allows for powerful string composition where complex expressions can be embedded directly within string templates.