In JavaScript, this is a big no-no:
function Set() {
}
Set.prototype.content = [];The problem is that when you create multiptle Set objects, their content property points to the same object. When one modifies that object, all the other instances will be updated.
Thus, I was very surpsied when I saw
defrecord Company, [
name: nil, employees: HashDict.new, autoid: 1
] do
Given my background, I was really worried about that HashDict.new being shared across all Companys. Of course, in Elixir, that's not a problem. That record is immutable. As soon as a company wants to modify it, it has to replace it with a new one!