0
我是學習Node.js的新手。爲什麼console.log會給我定義?我希望它能打印出'Hello World!'代替。我錯在哪裏?Nodejs調用函數
謝謝!
function Greetr() {
this.greeting = 'Hello World!';
}
Greetr.prototype.greet = function() {
console.log(this.greeting);
}
Greetr.prototype.greet();
可能重複調用你
greet
功能是否有functionName調用函數之間有什麼區別.prototype.methodName()和funObject.methodName()?](https://stackoverflow.com/questions/44517936/is-there-any-difference-between-calling-function-in-functionname-prototype-metho) –