Values & References6 / 18
Up next

Objects share a reference

const a = { count: 0 };
// b names the SAME object, not a copy
const b = a;
b.count = 5;
console.log(a.count);
What you're solving

assignment aliases the same object