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 trialJoseph Quintiliano
Front End Web Development Techdegree Graduate 14,338 PointsWhy dont we wrap the parameter, elementName, in single quotes so we dont have to remember to include them later
for const element = document.createElement();
Would surrounding the template literal of elementName with single quotes, to then follow up with surrounding the single quotes with back ticks...would this be considered good practice when coding?
1 Answer
Steven Parker
231,269 PointsThe example above doesn't show any template literals, but template literals must always be enclosed in back ticks. Single or double quote characters are fine for normal strings, but the system won't recognize them as template literals.
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsBella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsHi Joseph!
Could you please give an example scenario of what you're asking? That would help a lot in answering your question.