'Trying to use template literals to have the following '"$music" from:username' in js

I need to have the following output

'"$music" from:username'

the variables for the music part are req.body.title and the username is req.body.twitter

I can't for the life of me figure out how to do these with concatenation or template literals I have tried this which works

query: `"$music" from:${req.body.twitter}`,

but not sure how to get the whole "$music" part from the variable req.body.title in there, if it's not this format it fails on the twitter search API.

Any help would be greatly appreciated Thanks



Solution 1:[1]

Sorry for such a terrible question, but this is what I had to do

  query: `"$${req.body.title}" from:${req.body.twitter}`,

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anders Kitson