Modify a Constant
suggest changeMY_CONSTANT = "Hello, world"
MY_CONSTANT = "Hullo, world"
The above code warns, because the constant is assigned twice. Mutating the object the constant refers to does not warn. This changes the second character:
MY_CONSTANT = "Hello, world"
MY_CONSTANT[1] = "u"
Now, after changing the second letter of MY_CONSTANT, it becomes "Hullo, world".
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents