我有一个以字符串为键,以数组为值的地图。如何向具有相同键的数组添加值?
addToMap(childBundleRowCounter, entityId) {
if (this.rowCountMap.get(entityId) == undefined) {
this.rowCountMap.set(entityId, new Array(childBundleRowCounter));
} else {
this.rowCountMap.set(entityId, (this.rowCountMap.get(entityId)).push(childBundleRowCounter));
}
}