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

Joseph Quintiliano
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Joseph Quintiliano
Front End Web Development Techdegree Graduate 14,338 Points

Why 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
Steven Parker
229,695 Points

The 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.