I wrote a code and I want to see "Hello, world!"
each second, but I've got undefined
and I can't find where is my mistake.
function Greeting(message, delay) {
this.message = message;
setTimeout(this.blowUp, delay * 1000);
}
Greeting.prototype.blowUp = function () {
console.log(this.message);
};
new Greeting("Hello, world!", 1);