> > complain.erase(parseInt(element.get('id')));
>
> +'string' is faster cross-browser than parseInt('string').
they don't always render the same results though:
["crap012", "12crap", "012no", "12", "08", "172px"].forEach(function(what) {
console.log(typeof(+what), +what, parseInt(what));
});
result:
number NaN NaN
number NaN 12
number NaN 10
number 12 12
number 8 0
number NaN 172
now, the 08 one is 0 and the 3rd has a 10 due to lack ot radix, granted,
but it serves the purpose of showing a difference.
the ones that really differ are "12crap" and "172px" - the paseInt here
effectively strips non alphas whereas +"12crap" is NaN.
particularly useful when dealing with styles in px, for instance.
--
Dimitar Christoff <[email protected]> - http://fragged.org/
--
Subscription settings:
http://groups.google.com/group/mootools-users/subscribe?hl=en