«   Previous tip Next tip   »

VS Code: Automatically convert concatenated strings to use template strings

Last updated: 19th July 2020
Automatically convert concatenated strings to use template strings

You can convert concatenated strings to use template strings from the Refactor context menu, or clicking the lightbulb icon when it appears. This can convert your code from this:

const string = 'This is a ' + cake.type + ' cake.'

Into this:

const string = `This is a ${cake.type} cake.`

I also shared this on twitter!

«   Previous tip Next tip   »

Sign up to receive a developer tip, in the form of a gif, in your inbox each week