From 0b2682d705728702b1d70618417d09ccf6605da9 Mon Sep 17 00:00:00 2001 From: joaquinelio Date: Tue, 3 Jun 2025 14:29:47 -0300 Subject: [PATCH] replace args by params --- 1-js/02-first-steps/17-arrow-functions-basics/article.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1-js/02-first-steps/17-arrow-functions-basics/article.md b/1-js/02-first-steps/17-arrow-functions-basics/article.md index 50c0d475da..97e5e2d857 100644 --- a/1-js/02-first-steps/17-arrow-functions-basics/article.md +++ b/1-js/02-first-steps/17-arrow-functions-basics/article.md @@ -8,7 +8,7 @@ It's called "arrow functions", because it looks like this: let func = (arg1, arg2, ..., argN) => expression; ``` -This creates a function `func` that accepts arguments `arg1..argN`, then evaluates the `expression` on the right side with their use and returns its result. +This creates a function `func` with parameters `arg1..argN`, then evaluates the `expression` on the right side with their use and returns its result. In other words, it's the shorter version of: @@ -33,9 +33,9 @@ let sum = function(a, b) { alert( sum(1, 2) ); // 3 ``` -As you can see, `(a, b) => a + b` means a function that accepts two arguments named `a` and `b`. Upon the execution, it evaluates the expression `a + b` and returns the result. +As you can see, `(a, b) => a + b` means a function that defines two parameters named `a` and `b`. Upon the execution, it evaluates the expression `a + b` and returns the result. -- If we have only one argument, then parentheses around parameters can be omitted, making that even shorter. +- If we have only one parameter, then parentheses around it can be omitted, making that even shorter. For example: @@ -48,7 +48,7 @@ As you can see, `(a, b) => a + b` means a function that accepts two arguments na alert( double(3) ); // 6 ``` -- If there are no arguments, parentheses are empty, but they must be present: +- If there are no parameters, parentheses are empty, but they must be present: ```js run let sayHi = () => alert("Hello!"); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy