views:

510

answers:

3

I’m looking for equivalent functionality to C# regions in javascript

C# syntax

#region RegionName

public static void MyFunction()
{
    [mycode]
}

#endregion

This allows me to “collapse” my code in my .js file with Visual Studio and make it a little more manageable.

Anybody got any ideas?

+3  A: 

Take a look at this article, which implements the #region directives in js files using macros.

Brandon
+1  A: 

There is a javascript outlining extension for VS 2010 here http://jsoutlining.codeplex.com/documentation it works great for me

scepak
This is great! Thanks!
someweather
A: 

Javascript outlining extension for VS 2010 here http://jsoutlining.codeplex.com/documentation

scepak