7 ms·
7 is with the instanceof pattern. You add an if statement at the beginning of the function. If "this" is global you return a new object.
by mitchi 12y ago
7 is with the instanceof pattern. You add an if statement at the beginning of the function. If "this" is global you return a new object.