Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introduction to jQuery Hello, jQuery! The jQuery Object

Vic Mercier
Vic Mercier
3,276 Points

How would I do to replace the string interpellation ${} method by its full name method?

How would I do to replace the string interpellation ${} method by its full name method?Because I want to avoid problem with the dollar sign.

Keith Kelly
Keith Kelly
21,326 Points

Can you show some code as an example? Are you using the ${} inside of a template literal? If so that will not cause a conflict with jquery since the $ is contained between the backticks of the template literal.

Vic Mercier
Vic Mercier
3,276 Points

const name = "Victor" const named = ${name};

1 Answer

Steven Parker
Steven Parker
231,269 Points

Please explain the "problem with the dollar sign" — perhaps it is something that can be solved.

In the meantime, I'm not sure what the "full name method" is, but you can easily convert interpolation into concatenation. Here's an example:

console.log(`Hello, ${name}, and welcome to the ${place}!`);            // interpolation
console.log("Hello, " + name + ", and welcome to the " + place + "!");  // concatenation
Vic Mercier
Vic Mercier
3,276 Points

I mean if you do with jQuery: $() it may be confused

Steven Parker
Steven Parker
231,269 Points

Oh, in open code, the $ stands for jQuery. But as Keith pointed out, in a string interpolation the $ is inside a pair of accents ("backticks") and will be handled differently. The system will not be confused.

Vic Mercier
Vic Mercier
3,276 Points

Even if your jQuery is put in a javasript file which has also the interpolation?

//Can you answer to my other questions

Steven Parker
Steven Parker
231,269 Points

Yes, particularly then. The $ in open code is jQuery, and the $ inside accents is interpolation. No confusion.