关于Arguments对象

The arguments object is an Array-like object corresponding to the arguments passed to a function.

The arguments object is not an Array. It is similar to an Array, but does not have any Array properties except length. For example, it does not have the popmethod. However it can be converted to a real Array:

----MDN

  • 根据MDN上的描述 :
    Arguments只是一个类数组的对象,并不是一个真的数组,它只有一个length属性,但是可以转化成数组:
var args = Array.prototype.slice.call(arguments);
var args = [].slice.call(arguments);

// ES2015 
//The Array.from() method creates a new Array instance
// from an array-like or iterable object.
const args = Array.from(arguments);
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,871评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 11,195评论 0 23
  • 关键词的提取,善于从技术问题,技术效果入手,上下位概念的关键词也要关注,有的时候同一技术术语会有不同的表述习惯,如...
    悄吟mg阅读 398评论 0 0
  • 春雨润万物,相思情更深。 坟冢化纸钱,泪痕忆亲人。
    独秀郛邑间阅读 176评论 1 7
  • 夏…… 春华已去…… 此时的江南…… 连绵的雨…… 潮湿……闷热…… 亦如那份思念…… 曾几何时…… 忘却了……又...
    晔0114阅读 133评论 0 0

友情链接更多精彩内容