Say (for reasons) I'm using object wrappers on primitive values, like this:
var x = new Number (7);
x.source = "never-you-mind";
console.log(x);
// Number {7, source: 'never-you-mind'}
How might I go about changing that primitive value without losing the object properties?
// do magic here
console.log(x);
// Number {777, source: 'never-you-mind'}
Or is it the case that the primitive value is immutable, and I need to construct a wholly new object-wrapped-primitive and then copy those properties across? (Which I'll probably do with a function).