构造函数与原型继承的使用

 
function createFn(name){
        this.name = name ;
    }
    createFn.prototype.study = function(){
        return this.name+"在学习";;
    }
    var createFn2 = new createFn("tom");
    alert(createFn2.study());//方法调用需要加括号。



原文地址:https://www.cnblogs.com/l8l8/p/8886131.html