Copied objects persist to original object

If I have an object for example = "test"
and I copy Recipes to ‘d’
d = Recipes
then change = "different name"
I find now = "different name"

Is this a planned thing with objects or a bug?

Seems this is the way to copy Objects without retaining the reference to the original object…

d = JSON.parse(JSON.stringify(Recipes))

That’s a valid way of doing this.

JavaScript copies by value on simple variables (strings, numbers) and copies by reference for objects.

There are many articles with discuss this. Here’s one.