From 8f7871ed0a30c4a633bbee5249c7203ff89ee546 Mon Sep 17 00:00:00 2001 From: Dawn Rose <63545980+tastethedream@users.noreply.github.com> Date: Tue, 6 Dec 2022 08:24:14 +0000 Subject: [PATCH] Update ex5-4.md Code changed to reflect QC2 section 4.4 --- ch05/ex5-4.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ch05/ex5-4.md b/ch05/ex5-4.md index 427b5dd..8f94687 100644 --- a/ch05/ex5-4.md +++ b/ch05/ex5-4.md @@ -1,11 +1,15 @@ -# 5.4 Working with Lists +# 5.4 Handling Map Key/Value Pairings # Example ```dart void main() { - List listMonths = ['January', 'February', 'March']; + Map mapMonths = {0: 'January', 1: 'February', 2: 'March'}; + Map moreMonths = {3: 'April', 4: 'May'}; + mapMonths.addEntries(moreMonths.entries); - listMonths.forEach(print); + mapMonths.forEach((key, value){ + print('$key: $value'); + }) } ```