首先要明白 new 调用的过程做了什么
function myNew(className, ...args) { const obj = {} const ret = className.call(obj, ...args) obj.__proto__ = className.prototype return (typeof ret === 'object' && ret) ? ret : obj}