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 trialMasud Rana
2,865 Pointswe learned to add HTML from JS with querySelector method but here we see a different method, he doesn't explain this.
As we learned earlier in java script course we have learned to add javascript querySelector mehtod but here we see instructor has been using different method and he did not explaining this. Can anybody from treehouse tell me why this happening?
Anton Paluykh
8,994 PointsYou are right. JS Basics was updated with es2015. And this course is a little bit out of date. They have promised to update this course in May2020 , but now I see it will be only in June 2020. I think you mean this as it it was with Guil at JS basics
const printList = list => {
let listArtist = '';
for ( let i = 0; i < list.length; i += 1) {
listArtist += `<li>${list[i]}</li>`;
}
document.querySelector('ol').innerHTML = listArtist;
}
5 Answers
Steven Parker
231,236 PointsThe course that most thoroughly covers how JavaScript and HTML interact is JavaScript and the DOM. You may want to take it next, or even set this one aside and take it first and return to this one aftewards.
Masud Rana
2,865 Pointsok. I mean here in the video teacher is printing something in the HTML file form the Java Script file. i do not understand how this is happening here. And he did not expalin how HTML and JS is interacting with each other.
Masud Rana
2,865 PointsThat was in JavaScrip Basic course, "working with the string" Section and the lecure title was "Display the Value of a String on a Page". The main thing is what the teacher is doing here something with java script and HTML is totaly unclear and confusing.
Steven Parker
231,236 PointsI meant what method is being used in this course, and what time index in this video (the one linked to the "Watch Video" buton above).
Nasra Iid
Front End Web Development Techdegree Student 9,876 PointsGuil did it using string interpolation ${} .. where as this course is using string concatenation.
At the beginning of this course they did say " feel free to use string interpolation" and const and let instead of var
Masud Rana
2,865 PointsThanks.
Steven Parker
231,236 PointsSteven Parker
231,236 PointsWhich other method are you referring to, and at what time in the video is it used?