To add a JavaScript source file to a project follow these instructions:
Right-click on the project and select New --> Other
In the New Wizard navigate to the Web Folder and expand it to reveal the JavaScript entry. Select JavaScript and click Next
Type a file name name in the File name field and click Finish