Skip to content

Instantly share code, notes, and snippets.

@rtivital
Created May 29, 2016 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtivital/3085a9ba7a0e720aef375f710c742342 to your computer and use it in GitHub Desktop.
Save rtivital/3085a9ba7a0e720aef375f710c742342 to your computer and use it in GitHub Desktop.
// Первый способ
var Table = function(names) {
this.names = names;
this.tbody = document.querySelector('.tbody');
}
Table.prototype.render = function() {
var self = this;
setInterval(function() {
var x = self.tbody.children.length;
}
}, 1000);
}
// Второй способ
var Table = function(names) {
this.names = names;
this.tbody = document.querySelector('.tbody');
this.fn = function() {
var x = this.tbody.children.length;
};
};
Table.prototype.render = function() {
setInterval(this.fn.bind(this), 1000);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment