From 7d444625b14428904a8726086f23db4df925a2dd Mon Sep 17 00:00:00 2001 From: jaskirank1 <114716349+jaskirank1@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:17:35 +0530 Subject: [PATCH] Update article.md - Improved arrow function "arguments" example Improved arrow function "arguments" example in rest/spread parameters article --- .../02-rest-parameters-spread/article.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md index dbdfbd6c0d..3da5d9f7ff 100644 --- a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md +++ b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md @@ -110,12 +110,17 @@ If we access the `arguments` object from an arrow function, it takes them from t Here's an example: ```js run -function f() { - let showArg = () => alert(arguments[0]); - showArg(); +function f(){ + + alert(arguments[0]); + let arrow = msg => { + alert(msg); + alert(arguments[0]); // arguments stores all the arguments passed to a function so this arguments must store the parameters that are passed while calling arrow function right? + } + arrow(arguments[1]); } -f(1); // 1 +f(1, "Hii"); // 1 Hii 1 ``` As we remember, arrow functions don't have their own `this`. Now we know they don't have the special `arguments` object either.