Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript深入之创建对象,继承的多种方式以及优缺点 #3

Open
chenshuhong opened this issue Aug 22, 2019 · 1 comment
Labels

Comments

@chenshuhong
Copy link
Owner

chenshuhong commented Aug 22, 2019

JavaScript深入之创建对象的多种方式以及优缺点
JavaScript深入之继承的多种方式以及优缺点

@chenshuhong
Copy link
Owner Author

Object.create 的模拟实现

Object.create2 = function( o ) {
    function f(){}
    f.prototype = o;
    return new f;
};

@chenshuhong chenshuhong added the js label Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant