my favorite


YUI 3.3 Array method

in YUI 3.3 we have some syntax sugar to deal w/ dirty daily-life code snippets

In case I need a set of NodeList (myClass) elements, in previous version we have to use geeky style like below

Y.all(Y.all('.myClass')._nodes.slice(0, n-1));

not that elegant, right!?

Currently in YUI 3.3 we have public slice method for return NodeList, that say, we can use a better presentation

Y.all('.myClass').slice(0, n-1));

and it equals to below syntax in jQuery



No comments:


Taipei, GuTing, Taiwan

huang47 | personal

huang47 | personal