什么意思>&燃气轮机&燃气轮机;javascript中的字符
今天我读了一些关于MDN的文章,发现了一些新的东西。在第11行中,我发现了一些类似的东西:什么意思>&燃气轮机&燃气轮机;javascript中的字符,javascript,ecmascript-5,ecma262,Javascript,Ecmascript 5,Ecma262,今天我读了一些关于MDN的文章,发现了一些新的东西。在第11行中,我发现了一些类似的东西: var t = Object( this ), len = t.length >>> 0, k = 0, value; 完整代码为: if ( 'function' !== typeof Array.prototype.reduce ) { Array.prototype.reduce = function( callback /*, initialValue*/ ) { 'use
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;
};
}
if('function'!==typeof Array.prototype.reduce){
Array.prototype.reduce=函数(callback/*,initialValue*/){
"严格使用",;
if(null==此| |“未定义”==此的类型){
抛出新类型错误(
'Array.prototype.reduce在null或未定义时调用';
}
if('function'!==回调类型){
抛出新类型错误(回调+'不是函数');
}
var t=Object(this),len=t.length>>>0,k=0,value;
如果(arguments.length>=2){
值=参数[1];
}否则{
而(k=len)
抛出新的TypeError(“减少没有初始值的空数组”);
值=t[k++];
}
对于(;k
所以第11行的字符是零填充右移运算符 为了使用运算符,JavaScript必须将参数转换为整数。移位0位对整数没有影响,因此在本程序中,移位仅用于确保正确的类型。。