Skip to content
Advertisement

Is there something similar to C# regions in JavaScript? Visual Studio 2017

I am doing work for somebody who would like their JavaScript library organized into categories: CRUD functions, Form functions, etc. They really like the utility of regions in C# and are asking for this in their JavaScript file. Any suggestions? I am using Visual Studio 2017 and Team Foundation Server.

Advertisement

Answer

Select the code you want to compress. Press Ctrl + M + H. That code will now be collapsible. For readability, comment above the “region” to give it a name.

Source: http://blog.degree.no/2013/05/define-a-region-in-javascript-files-visual-studio-2010-2012/

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement