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

function A(){}; var a1 = new A(); var a2 = new A(); a1.id === 1; a2.id === 2; 实现A #6

Open
zhangyanan0525 opened this issue Jul 5, 2018 · 0 comments

Comments

@zhangyanan0525
Copy link
Owner

zhangyanan0525 commented Jul 5, 2018

function A(){
    A.prototype.id=A.prototype.id+1
    this.id=A.prototype.id
}
A.prototype.id=0
var a1 = new A(); var a2 = new A();
@zhangyanan0525 zhangyanan0525 changed the title 有个function A(){} var a1 = new A();var a2 = new A(); a1.id = 1;a2.id = 2;实现A function A(){}; var a1 = new A(); var a2 = new A(); a1.id = 1; a2.id = 2; 实现A Jul 5, 2018
@zhangyanan0525 zhangyanan0525 changed the title function A(){}; var a1 = new A(); var a2 = new A(); a1.id = 1; a2.id = 2; 实现A function A(){}; var a1 = new A(); var a2 = new A(); a1.id === 1; a2.id === 2; 实现A Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant