Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a default JavaScript file naming convention?

So I’ve just started building my personal website, and I need an HTML file, a CSS file, and JavaScript file. But, I’m not sure what to name my JavaScript file. Here are some of my thoughts:

  • "index.js"
  • "app.js"
  • "main.js"

Please correct me if there is a default JavaScript file naming convention. Otherwise, I might go with "index.js" because it sounds the most natural.

Help would be appreciated!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It is really up to you, although index.js, app.js, and main.js are usually what is used to name the main javascript file of an application. For others module or component files, use a name that describes what the code within the file does, like services.js for a file that handle everything related to services section of your application.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading