Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

《Rest 参数与 Spread 语法》中可能存在的问题#972

Answeredbysonghn233
smallpigz asked this question inQ&A
Discussion options

在《Rest 参数与 Spread 语法》章节中介绍说明

Issues1

在该叙述下面的例子中用到 Spread 语法复制对象

Issues2

在前面的章节《Iterable **object(可迭代对象)》中介绍了普通对象不是迭代对象

所以对红框中的描述有点疑惑,找了MDN。

Issues3

大佬们,这个地方是否存在歧义😂

You must be logged in to vote

这两种说法是不冲突的。

第一种情况是在数组中使用 spread 语法,第二种是在对象字面量中使用 spread 语法

既然提到 MDN 文档的话,其实文档中也有说明

本教程该章节提到的「Spread 语法只适用于可迭代对象」是在Array.from[...obj] 的数组上下文的提到的,所以没有问题。

Replies: 1 comment 1 reply

Comment options

这两种说法是不冲突的。

第一种情况是在数组中使用 spread 语法,第二种是在对象字面量中使用 spread 语法

既然提到 MDN 文档的话,其实文档中也有说明

image

本教程该章节提到的「Spread 语法只适用于可迭代对象」是在Array.from[...obj] 的数组上下文的提到的,所以没有问题。

You must be logged in to vote
1 reply
@smallpigz
Comment options

明白了,谢谢解答😄

Answer selected bysonghn233
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@smallpigz@songhn233
Converted from issue

This discussion was converted from issue #971 on November 24, 2021 03:06.


[8]ページ先頭

©2009-2025 Movatter.jp