Tree.

isMap(obj)

Returns true if the indicated object is:

  • A standard JavaScript Map object
  • An AsyncMap object (an asynchronous variant of Map)
  • An object with the same interface as Map or AsyncMap: i.e., has the same methods and properties
$ ori "Tree.isMap(new Map())"
true
$ ori Tree.isMap {}
false
$ ori Tree.isMap []
false

See also isMaplike, a looser test that returns true if its input is a map or can be wrapped to be treated as one.