So I got a little surprised by:
Object.assign({}, Math)
Which returned an empty object. I was doing this to set up my own math module, that I could extend with my own custom functionality, so I thought it would be convenient to do:
Object.assign({}, Math, {
sqrt: <my-sqrt-implementation>,
add: <my-add-implementation >,
})
But I was surprised to find that the math entries were not included, why is that? In my console I get:
Object.assign({}, Math)
> {}
What went wrong, and how can this be fixed?