码迷,mamicode.com
首页 > Web开发 > 详细

一道常被人轻视的前端JS面试题

时间:2017-03-26 16:29:35      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:return   on()   console   js面试   学习   ons   this   prot   etag   

function Person() {

getAge = function() {

console.log(10);

}

return this;

}

Person.getAge = function() {

console.log(20);

}

Person.prototype.getAge = function() {

console.log(30);

}

var getAge = function() {

console.log(40);

}

function getAge() {

console.log(50);

}

Person.getAge();

getAge();

Person().getAge();

getAge();

new Person.getAge();

new Person().getAge();

new new Person().getAge();

学习交流群618237474?

一道常被人轻视的前端JS面试题

标签:return   on()   console   js面试   学习   ons   this   prot   etag   

原文地址:http://www.cnblogs.com/ZZZAB/p/6622867.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!