I can add Index.cshtml.css and use it but I can not add Index.cshtml.js why?
CSS files must be added in the <head> tag which is located in the layout.cshtml. While it has always been possible to inject CSS specific to a page/view, this is code you must write and maintain. The new CSS Isolation feature simply lets you add CSS at a page level.
A JavaScript file can be referenced from any location within the HTML. The convention is referencing JavaScript at the end of the HTML which is handled using the following convention.
@Section scripts {
}