3 ms·
As an aside, this is sort of a strange pattern: var ctor = "Collator"; // or the others var instance = new Intl[ctor](locales, options); What's the pu
by tlrobinson 12y ago
As an aside, this is sort of a strange pattern:
var ctor = "Collator"; // or the others
var instance = new Intl[ctor](locales, options);
What's the purpose "ctor" here? i.e. Why not just do "new Intl.Collator(locales, options)"? Is it just to demonstrate the other constructors have the same arguments?
- fourstar 12y ago`ctor` could be an array and `instance` could be initialized for each index in the array. I've done stuff like that when initializing Backbone views awhile ago.