When I try to delete a javascript Map key, the key seems to be deleted, and to stay at the same time. Array assigns ( e.g. map[a] = b
) are never used, and I totally don't know why it occurs :
For sensible datas reason, the keys (that are strings) are replaced by colors.
Lines:
1 : map before deleting the user
2 : user to delete (in the for loop)
3 : this._members.get(userId)
4 : this._members.delete(userId) => it works
5 : map after deleting the user
Code :
console.dir(this._members);
for (const userId of removedUserIds) {
console.dir(userId);
console.dir(this._members.get(userId));
console.dir(this._members.delete(userId));
}
console.dir(this._members);