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 trialCrystal Vesely
14,500 PointsIs there a difference between ./ and ../ like we use in CSS?
In CSS, we use (../) when linking to a file inside a folder, but in this demonstration, I noticed we are using (./) when requiring the records.js file. Can someone help me understand? Thanks so much!
1 Answer
Steven Parker
231,271 PointsThe prefix ./
means "in the same directory". In most cases it is optional, and can be left off entirely without any change in functionality.
On the other hand, the prefix ../
means "in the parent directory", and is necessary to show that the file you are referencing is not located in the same place as the one referencing it.