On Mon, May 16, 2011 at 1:15 PM, Jarek Foksa <[email protected]> wrote: > My questions: > - Why so many frameworks are deciding to provide a set of checkers > such as isArray(), isNull(), isFunction() instead of single type() > function? Is performance gain really noticeable when using simple type > checkers?
For what it's worth, YUI 3 has Y.Lang.type(), which does exactly what you describe. It also provides isArray(), isFunction(), etc. for convenience (and yes, these are often faster than the full generic type check). You can see the code at https://github.com/yui/yui3/blob/master/src/yui/js/yui-lang.js - Ryan -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
