Object.create()方法创建一个新对象,使用现有的对象来提供新创建的对象的proto
    手写一个Object.create

    1. function _create (o) {
    2. fucntion Fn () {};
    3. Fn.prototype = o;
    4. return new Fn();
    5. }
    6. let newObj = _create(obj);

    可以传参数的版本

    1. function _create (o) {
    2. let args = Array.prototype.slice(arguments, 1); // 拿到参数
    3. for (let i in args) {
    4. o.assign(o, i); // 循环参数浅拷贝给o
    5. }
    6. fucntion Fn () {};
    7. Fn.prototype = o;
    8. return new Fn(args);
    9. }
    10. let newObj = _create(obj);

    https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/create
    https://blog.csdn.net/qq_44752117/article/details/105627378
    https://www.jianshu.com/p/28d85bebe599 有关create和new的区别