What's the most efficient way to use reflection on a js object? Here's an example data structure:
var data = {
NortheastRegion:
{
RegionName: 'Northeast',
SomeGeneralRegionInfo: 'Info1'
}
SoutheastRegion:
{
RegionName: 'Southeast',
SomeGeneralRegionInfo: 'Info2'
}
}
Let's say I'd like to use a reflection style similar to this:
var regionName = 'SoutheastRegion';
var region = data[regionName];
var info = region.SomeGeneralRegionInfo;
What would be the most efficient way to do something like this?