One way is to use double backticks to wrap your code.
Example:
To display alert(`The sum is ${a + b}`);
, type ``alert(`The sum is ${a + b}`);``
.
But the double-tick approach will not work if you want to wrap an entire template string inside them, like this: `Sum: ${a + b}`
.
The trick here is to use triple backticks and a Zero-Width Space (ZWS) character. Example: ``[ZWS]`Sum: ${a + b}`[ZWS]``
.
GitHub's editor will display the ZWS characters as red dots, so they'll be easy to locate and edit.