.js extension and you can open them using any text editor. Your options start with Notepad and advance into modern IDEs like Visual Studio Code or WebStorm. If you love the terminal environment, you can even use tools like
If you want to open a JS file to run it, it’s totally different, though. You should first know which runtime it belongs to. For example, it could be a browser script or a server-side Node.js program and the approaches to running it will be different.