2014-06-19 45 views
0

今天,我阅读MDN一些文章,发现一些新的东西me.in这个link第11行我发现有些事情是这样的:拿什么>>>字符在JavaScript

var t = Object(this), len = t.length >>> 0, k = 0, value; 

完整的代码是:

if ('function' !== typeof Array.prototype.reduce) { 
Array.prototype.reduce = function(callback /*, initialValue*/) { 
'use strict'; 
if (null === this || 'undefined' === typeof this) { 
    throw new TypeError(
    'Array.prototype.reduce called on null or undefined'); 
} 
if ('function' !== typeof callback) { 
    throw new TypeError(callback + ' is not a function'); 
} 
var t = Object(this), len = t.length >>> 0, k = 0, value; 
if (arguments.length >= 2) { 
    value = arguments[1]; 
} else { 
    while (k < len && ! k in t) k++; 
    if (k >= len) 
    throw new TypeError('Reduce of empty array with no initial value'); 
    value = t[ k++ ]; 
} 
for (; k < len ; k++) { 
    if (k in t) { 
    value = callback(value, t[k], k, t); 
    } 
} 
return value; 
}; 
} 

等什么measns符合>>>字符11

+2

[零填充右移运算符](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Unsigned_right_shift)。 –

回答