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
| //custom string manipulation class | |
| class MyString { | |
| constructor(str) { | |
| this.str = str; | |
| } | |
| replaceVowels(replacement) { | |
| this.str = this.str.replace(/a|e|i|o|u/gi, replacement); | |
| } | |
| //The valueOf() method returns the primitive value of the specified object. | |
| valueOf() { |
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
| //executes a callback when all conditions are satisfied | |
| function WhenReady(obj, cb) { | |
| this.conditions = obj; | |
| this.readyCallback = cb; | |
| } | |
| WhenReady.prototype = { | |
| satisfyCondition: function(o) { | |
| if(typeof o == 'object') { |
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 Poller(interval, cb, limit) { | |
| var _this = this; | |
| this.interval = interval || 250; | |
| this.poll = null; | |
| this.limit = limit; | |
| var count = 0; | |
| this.poll = setInterval(function() { | |
| if(typeof cb == 'function') { | |
| if(_this.limit) { |
NewerOlder