If I understand correctly, I should be creating a Scripts folder in my Solutions Explorer folder, and then adding a javascript file that contains my program.
Then as I require my javascript file in a View, I call
<script type="text/javascript" src="@Url.Content("~/Scripts/name.js")"></script>
Followed by calling the function straight away.
However, this isn't working out for me. If I go to Networks tab of my application, it says could not find name.js at https://localhost:7240/Scripts/name.js. Could someone please let me know what I am missing in my code?
Edit: I used the technique mentioned in the comments and that works.
Please note: If you have made any changes in the code of name.js, it is possible your Google Chrome is still using your old cached version, so ctrl + shift + R and it'll automatically force update the new name.js.
Yes it is correct.
Create a script section at the end of your view. The source location refers to the folder under wwwroot/Apps folder as shown below