(function() {
function Fun(name) {
this.name = name;
}
Fun.prototype.say = function() {
console.log(this.name);
}
fun = new Fun();
})();
想在這裡調用,並傳參數進去???
fun.say('qwe')
(function(name) {
function Fun(name) {
this.name = name;
}
Fun.prototype.say = function() {
console.log(this.name);
}
fun = new Fun(name);
})('qwe');
fun.say();