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 classA = function(options){ | |
| if (this instanceof classA){ | |
| this.options = options; | |
| return this | |
| } else { | |
| return new classA(options) | |
| } | |
| } | |
| classA.prototype.someAsnyc = function(callback, flag){ |
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 globalTime = new Date().getTime(); | |
| var b = function(callback){ | |
| var date = new Date().getTime(); | |
| for (var i=0;i<10000;i++) | |
| callback(); | |
| console.log("Completed a function test in", new Date().getTime()-date); | |
| } | |
| b(function(){ | |
| var date = new Date().getTime(); | |
| //console.log("Started A at:", date-globalTime); |
NewerOlder