其他分享
首页 > 其他分享> > 九、扩展运算符

九、扩展运算符

作者:互联网

          <script>
		// 扩展运算符([...])能将[数组]转换为逗号分隔的[参数序列]
		// 声明一个数组
		const boys = ['胡歌','霍建华'];
		//声明一个函数
		function fn () {
			console.log(arguments); 
		}
		fn(boys);
		/*  Arguments [Array(2), callee: ƒ, Symbol(Symbol.iterator): ƒ]
            0: (2) ["胡歌", "霍建华"]
            callee: ƒ fn()
            length: 1
            Symbol(Symbol.iterator): ƒ values()
            __proto__: Object*/
		fn(...boys);
		/*
		Arguments(2) ["胡歌", "霍建华", callee: ƒ, Symbol(Symbol.iterator): ƒ]
            0: "胡歌"
            1: "霍建华"
            callee: ƒ fn()
            length: 2
            Symbol(Symbol.iterator): ƒ values()
            __proto__: Object
    		 */
	</script>

标签:__,iterator,Symbol,扩展,胡歌,运算符,callee,fn
来源: https://www.cnblogs.com/xiaoxuJS/p/14434326.html