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 Promise(){ | |
| this.callbacks = []; | |
| this.value = undefined; | |
| } | |
| Promise.prototype.success = function(callback){ | |
| this.callbacks.push(callback); | |
| if(this.value) | |
| this.execute_callbacks(); | |
| } |
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 merge_unique = function(array1, array2){ | |
| var len1 = array1.length; | |
| var len2 = array2.length; | |
| var buff = [] | |
| var i = 0, j = 0 | |
| while(i != len1 && j != len2){ | |
| if(array1[i] < array2[j]) | |
| buff.push(array1[i++]); | |
| else |
OlderNewer