Last active
December 21, 2015 04:19
-
-
Save leekiernan/6248266 to your computer and use it in GitHub Desktop.
Quick mock
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
function Counter(length) { | |
this.length = (typeof length == 'undefined') ? 5 : length; | |
this.iterator = (typeof this.iterator == 'undefined') ? 0 : this.iterator; | |
this.next = function() { | |
return ( this.iterator > this.length) ? this.iterator = 0 : this.iterator++; | |
} | |
this.slide = function() { | |
console.log("IT: "+ this.iterator ); | |
_next = this.next( this.iterator ); | |
console.log("count2: "+ this.iterator ); | |
return this.iterator; | |
} | |
this.count = function() { | |
}; | |
} | |
var a = new Counter(5); | |
setInterval( function() { return a.slide() }, 1000 ); | |
var b = new Counter(5); | |
setInterval( function() { return b.slide() }, 1000 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment