I recently saw this in some source code:
module.exports = Object.assign(function GamepadButton() {}, {
FACE_1: 0,
FACE_2: 1,
FACE_3: 2,
FACE_4: 3,
// etc...
});
Why would one do this? Why assign an object to an empty newly declared function? What's going on here? (I assume the module.exports is irrelevant here, but just in case it isn't, I've included that as well.)