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

面试题-代码输出 #53

Open
lcgyh opened this issue Nov 30, 2018 · 1 comment
Open

面试题-代码输出 #53

lcgyh opened this issue Nov 30, 2018 · 1 comment

Comments

@lcgyh
Copy link
Owner

lcgyh commented Nov 30, 2018

function Person(){
	getAge=function(){
		console.log('5');
	}
	return this
}

Person.getAge=function(){
	console.log(4)
}
Person.prototype.getAge=function(){
	console.log('3')
}

var getAge=function(){
	console.log('2')
}

function getAge(){
	console.log(1)
}

getAge();
Person.getAge();
Person().getAge();
getAge();
new Person.getAge();
new Person().getAge();
@lcgyh
Copy link
Owner Author

lcgyh commented Nov 30, 2018

2,4,5,5,4,3

@lcgyh lcgyh changed the title 面试题 面试题-代码输出 Nov 30, 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