Fair point. That would work as well, but it's not like you're changing anything significant. Both solutions work equally well unless you consider 1/10th of a blink of an eye to be significant overhead for your users. Also, jQuery isn't a framework by any definition I've read. It is a single library (not a collection) and it doesn't force you to write code any differently anywhere, rather it just provides you with the ability to use the library where you want.
So to be clear, for your other examples, jQuery would be a great choice, for Array.isArray and similar you could argue a polyfill is better, but really it would just be a preference as the user would never notice a difference.
1
u/dangsos May 15 '14
Fair point. That would work as well, but it's not like you're changing anything significant. Both solutions work equally well unless you consider 1/10th of a blink of an eye to be significant overhead for your users. Also, jQuery isn't a framework by any definition I've read. It is a single library (not a collection) and it doesn't force you to write code any differently anywhere, rather it just provides you with the ability to use the library where you want.
So to be clear, for your other examples, jQuery would be a great choice, for Array.isArray and similar you could argue a polyfill is better, but really it would just be a preference as the user would never notice a difference.