ee.Dictionary

Constructs a new Dictionary.

UsageReturns
ee.Dictionary(dict)Dictionary
ArgumentTypeDetails
dictComputedObject|Object, optional

An object to convert to a dictionary. This constructor accepts the following types: 1) Another dictionary. 2) A list of key/value pairs. 3) A null or no argument (producing an empty dictionary)

Examples

Code Editor (JavaScript)

// A dictionary input (e.g. results of ee.Image.reduceRegion of an S2 image).
var dict = {
  B1: 182,
  B2: 219,
  B3: 443
};
print('ee.Dictionary from dictionary input', ee.Dictionary(dict));

// A list of key/value pairs (from previous dictionary).
var list = [
  'B1', 182,
  'B2', 219,
  'B3', 443
];
print('ee.Dictionary from list input', ee.Dictionary(list));