Primitive values are passed by copy. As Primitives are copied by values.

let a = 10;
let b = a; // make a copy in b

a = 20

console.log(a); // Output: 20
console.log(b); // Output: 10

Objects are passed by reference. As Object are copied by reference.

let a = { value: 10 };
let b = a;

a.value = 100;

console.log(a); //Output: { value: 100 }
console.log(b); //Output: { value: 100 }