Object mapToJSObj(Map<dynamic, dynamic> map) { var object = js.newObject(); map.forEach((k, v) { var key = k; var value = v; js.setProperty(object, key, value); }); return object; }