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 REST APIs with Express Managing Data and Asynchronous Code Refactor the Get All Quotes Route

Crystal Vesely
Crystal Vesely
14,500 Points

Is 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
Steven Parker
231,271 Points

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