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

第3题(2019-07-24):请使用原型链相关知识实现b继承n=1;c继承n=2;m=3 #19

Open
qappleh opened this issue Aug 19, 2019 · 0 comments
Labels

Comments

@qappleh
Copy link
Owner

qappleh commented Aug 19, 2019

答案:

var obj = function(){}
obj.prototype.n = 1;
var b = new obj();
obj.prototype = {
	n:2,
	m:3
}
var c = new obj();
console.log(b.n,b.m,c.n,c.m)  
@qappleh qappleh added the js label Nov 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