number >>> 0 is: - number if number >= 0 - (the highest number) - number if number < 0 So it makes sure the number is positive but if it is negative, as it should be positive, it assumes it is the number to go down from the highest number, which makes more sence than just taking the minus sign off with Math.abs or putting 0.
On Tue, Aug 30, 2011 at 11:47 AM, Matthias Reuter <[email protected]> wrote: > I use the shims given on MDC. I got slapped for it twice because other > developers could not make any sense from some lines ("What does var len = > t.length >>> 0; do? Can't we write that any simpler?"). I edited some minor > parts because closure compiler stumbled upon (1 / 0), but generally, I have > not encountered any real problems. Well, JSLint complains a lot, so I ignore > JSLint warnings for that file. > > Matt > > -- > 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] > -- 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]
