Tuesday 16 April 2019

javascript - Why variable doesn`t increase?

Why variable doesn`t increase?





function Ticker() {
this._i = 0
}


Ticker.prototype = {
tick: function() {
console.log(this._i++);
}
}

var ticker = new Ticker();
setInterval(ticker.tick, 1000);






and what _ means?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...