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 Object-Oriented JavaScript: Challenge Introducing 'Four in a Row' Creating Class Files

Luke Markham
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Luke Markham
Front End Web Development Techdegree Graduate 17,289 Points

Creation of classes

In terms of creating these classes. There are many js folders. each step has a js folder. Surely we're not expected to go and make the relevant js files for every stage step ?!

Why does each step have its own HTML,CSS & Js file ?

cheers :D

3 Answers

Jacob Dahlberg
seal-mask
.a{fill-rule:evenodd;}techdegree
Jacob Dahlberg
Python Development Techdegree Student 13,154 Points

Continuing on this discussion. I'm confused, it's not explicitly stated where and how to manage files for this course. Where do I store each of these class files, together? Reading the Final Complete Project folder files to try to understand, it looks like we're building up these 6 files incrementally as we go along in the course. Is that correct?

I'm starting to get the big picture of it, I'd recommend doing a 2 min intro video on managing the multiple files specific to this course as a basis for projects we'll encounter.

Seeing the other discussion Answer:

The code from each file loaded remains as the code from the others is added to it, so when the loading is complete it is essentially the same as if all the code had been in one single file.

So functions in one file can be called from code loaded from another file.

I'd like a quick instruction on how this all works before staring into the daunting 30+ folders with multiple files. Any thoughts from experienced coders?

Thanks All!

Rick Gleitz
Rick Gleitz
47,878 Points

Usually in these courses (I haven't taken this one) all the JavaScript is placed in one .js file. The instructor may update it in each subsequent step to reflect the current progress of the instruction.

Rick Gleitz
Rick Gleitz
47,878 Points

Yup! And it gits a bit hairy when you start into libraries and frameworks, like React and Laravel, which I'm just starting. Keep coding!