>>> (Zero zero sequence offset) Development

Possible duplicate:
What good does a zero-shift bit shift of 0 do? (β†’ β†’ 0)

I looked at array.indexOf() and I know that IE7 does not support this. I read MDC and saw their prototype example in browsers that don't support it. I read it, trying to understand how everything works, but I'm not sure I understand it 100%. The main reason for the confusion is bitwise operators, in particular >>> . I am not sure why this operator is useful. The following is a way to use them. Can someone explain why this is useful and why you can't just if (t.length === 0) ?

  var t = Object(this); var len = t.length >>> 0; if (len === 0) return -1; 
+4
source share
1 answer

Allows indexOf call array objects that may have strange length properties.

For instance:

 var fakeArray = { length: -3, '0': true, '1': false, '2': null }; 
+6
source

All Articles