From f7bc67c256a0c7de982e737a6b0b3ca31cee671b Mon Sep 17 00:00:00 2001 From: Xavier Render Date: Tue, 21 Jun 2022 22:14:51 +0800 Subject: [PATCH] Update 07_day_functions.md (Line 238 and 250) Unlimited number of parameters, needs to add ". . . arguments" inside the square bracket. --- 07_Day_Functions/07_day_functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/07_Day_Functions/07_day_functions.md b/07_Day_Functions/07_day_functions.md index 17d9087..360dcd3 100644 --- a/07_Day_Functions/07_day_functions.md +++ b/07_Day_Functions/07_day_functions.md @@ -235,7 +235,7 @@ Sometimes we do not know how many arguments the user going to pass. Therefore, w ```js // Let us access the arguments object ​ -function sumAllNums() { +function sumAllNums(...arguments) { console.log(arguments) } @@ -247,7 +247,7 @@ sumAllNums(1, 2, 3, 4) ```js // function declaration ​ -function sumAllNums() { +function sumAllNums(...arguments) { let sum = 0 for (let i = 0; i < arguments.length; i++) { sum += arguments[i] @@ -705,4 +705,4 @@ It Will be covered in other section. 🎉 CONGRATULATIONS ! 🎉 -[<< Day 6](../06_Day_Loops/06_day_loops.md) | [Day 8 >>](../08_Day_Objects/08_day_objects.md) \ No newline at end of file +[<< Day 6](../06_Day_Loops/06_day_loops.md) | [Day 8 >>](../08_Day_Objects/08_day_objects.md)