Search code examples
idictionaryjscript.net

Dictionary object syntax?


I'm having trouble figuring out the syntax for a JScript .NET dictionary object. I have tried

private var myDictionary: Dictionary<string><string>;

but the compiler complains that it's missing a semicolon and that the Dictionary object is not declared.

I know JScript does have a native dictionary-like object format, but I'm not sure if there are disadvantages to using it instead of the .NET-specific construct. I.e., what if someone wants to extend my script using another .NET language?


Solution

  • JScript.Net doesn't support generic types and methods.

    Check this link:

    http://msdn.microsoft.com/en-us/library/xfhwa508(v=VS.80).aspx

    Click on the JScript Tab under Syntax heading.