Strings are immutable. That means when I change a string - new string reference created instead.
If so how "foo" === "foo"
give me true
value?
The ===
compares by reference location in the memory and not by the value.
So, the first string should be new reference somewhere is the memory and the another foo
should be save somewhere else in the memory.
How it is possible?