Skip to content

Commit 4dddbe4

Browse files
Refine .addEntries() method documentation
Clarified the explanation of the .addEntries() method and updated parameter descriptions.
1 parent c7e760c commit 4dddbe4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

content/dart/concepts/map/terms/add-entries/add-entries.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,21 @@ CatalogContent:
1313
- 'paths/computer-science'
1414
---
1515

16-
In Dart, the **`.addEntries()`** method allows you to add multiple key-value pairs to an existing `Map` by providing it with an iterable of `MapEntry` objects. This is useful when inserting several entries at once, especially when transforming lists into maps or combining data from multiple sources.
16+
In Dart, the **`.addEntries()`** method adds multiple key-value pairs to an existing `Map` using an iterable of `MapEntry` objects. It’s useful for inserting several entries at once, such as when transforming lists into maps or merging data.
1717

1818
## Syntax
1919

2020
```pseudo
2121
mapVariable.addEntries(iterableOfMapEntries)
2222
```
2323

24-
- `mapVariable`: The map you want to add entries into.
25-
- `iterableOfMapEntries`: An iterable containing `MapEntry` objects (`MapEntry(key, value)`).
24+
**Parameters:**
25+
26+
- `iterableOfMapEntries`: An iterable of `MapEntry<K, V>` objects, where `K` and `V` match the map’s key and value types.
27+
28+
**Return value:**
29+
30+
- `void`: The method does not return anything; it modifies the existing map in place.
2631

2732
## Example
2833

@@ -47,7 +52,7 @@ void main() {
4752
}
4853
```
4954

50-
**Output:**
55+
The output of this code is as follows:
5156

5257
```shell
5358
{Apples: 5, Bananas: 3, Oranges: 4, Grapes: 10}

0 commit comments

Comments
 (0)