1
假設我有這樣的班級。私人和特權方法的區別
function kevin(name){
this.name = name;
this.methodKevin = function(){
console.log(this.name);
};
var kevin = function(){
console.log(this.name);
}
function newKevin(){
console.log(this.name);
}
}
- 是什麼在JavaScript中它們之間的區別?
- 我的課程是否完美,我可以在我的 構造函數中使用函數表達式嗎?
你有沒有想出名字「priviledge方法」?我認爲這是Brillant。 –
@MattiVirkkunen:無論如何......錯......它的特權方法。 – Kevin
我從來沒有聽說過那個。 –