I created an object const with a data and I made other const from the first. But my problem is when I change the second object, my first const also is changed.
Have a method to resolve this?
const user1 = {
name: "samuel"
}
const user2 = user1;
user2.name = "guedes";
console.log(user1); //output: "guedes"
console.log(user2); //output: "guedes"