Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ new Map(iterable)
### Parameters

- `iterable` {{optional_inline}}
- : An {{jsxref("Array")}} or other
[iterable](/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) object
whose elements are key-value pairs. (For example, arrays with two elements,
such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the
new `Map`.
- : If an [iterable object](/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) (such as an array) is passed, all of its elements will be added to the new `Map`. Each element must be an object with two properties: `0` and `1`, which correspond to the key and value (for example, `[[1, "one"],[2, "two"]]`). If you don't specify this parameter, or its value is `null` or `undefined`, the new `Map` is empty.

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ new Set(iterable)
### Parameters

- `iterable` {{optional_inline}}
- : If an [iterable object](/en-US/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new
`Set`.

If you don't specify this parameter, or its value is `null`, the new
`Set` is empty.
- : If an [iterable object](/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) (such as an array) is passed, all of its elements will be added to the new `Set`. If you don't specify this parameter, or its value is `null` or `undefined`, the new `Set` is empty.

### Return value

Expand Down