ASP.NET Pack Programmer's Guide
Dictionary.contains Method
See Also
 





Determines whether the Dictionary contains a specific key.

Namespace: MindFusion.Mapping
Package: Dictionary.js

 Syntax

JavaScript  Copy Code

function contains (key)

 Parameters

key

Object. The key to locate in the dictionary.

 Return Value

Boolean. true if the element exists in the collection, otherwise false.

 Example

The following code creates a new Dictionary and adds three LatLong instances with keys the cities they belong to. Then it checks if Paris is among the keys of the Dictionary:

JavaScript  Copy Code

var m = MindFusion.Mapping;

var locations = new m.Dictionary();
locations.set("Paris", new m.LatLong(-22.951916, -43.210487));
locations.set("Sidney", new m.LatLong(40.284218, -84.155502));
locations.set("Lima", new m.LatLong(-12.046373, -77.042755));
...............
if( locations.contains("Paris") )
{
    var _parisLoc = locations.get("Paris");
}

 See Also

Dictionary Members
Dictionary Class
MindFusion.Mapping Namespace