Created
May 29, 2016 09:21
-
-
Save rtivital/3085a9ba7a0e720aef375f710c742342 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Первый способ | |
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