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 JavaScript Objects Loop Through Objects Display an Array of Objects on the Page – One Solution

Tabbing in Template Literals

Are template literals sensitive to tabbing white-space, or are they only sensitive to space and line-break whitespace?

1 Answer

I just ran something of a test

I can't show you the code in here because you can't use tabs in the posting text area.

But from what I can tell, tabs in template literals are treated as (converted to) single spaces.

In fact, "tab space tab space tab" will also be treated (converted to) as a single space - even if you store it in a variable and use it that way.

(same for line-break whitespace, as well)

Try running some experiments here:

https://jsfiddle.net/

I hope that helps.

Stay safe and happy coding!