真数组与伪数组

//真数组与伪数组的区别
真数组的长度是可变的,伪数组的长度是不可变的
真数组可以使用数组中的方法
伪数组不可以使用数组中的方法

function f1(){
	var sum = 0;
	for(var i=0;i<aruments.length;i++){
		sum += arguments[i];
		
	}
	console.log(sum);
	//arguments得到的是实参的个数及实参的每个值 是伪数组
	
}
f1(10,20,30)
Array.prototype.forEach = function(callback,thisArg){
	
}

猜你喜欢

转载自blog.csdn.net/weixin_42355871/article/details/83543327