Skip to content

Commit 5f8ae98

Browse files
committed
updated functions fundamental
1 parent 58b5197 commit 5f8ae98

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

fundamentals/functions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Consider this **function** from [high-school math](https://www.mathplanet.com/ed
88
>
99
> 𝑓(2) = 2 + 7 = 9
1010
11-
The value of the function 𝑓(x) is dependent on the value you supply for its argument x. (Instead of the term 'argument', sometimes the word 'parameter' is used). This function adds 7 to the value of its argument. Whenever we need to add 7 to some number we can reuse this same function over and over again.
11+
The value of the function 𝑓(x) is dependent on the value you supply for its argument x. (Instead of the term 'argument', sometimes the word 'parameter' is used).
1212

1313
Here is the equivalent JavaScript function:
1414

@@ -22,7 +22,9 @@ function f(x) {
2222
console.log(f(2)); // -> 9
2323
```
2424

25-
During execution, the value of x in the function body (the part between the curly braces) is substituted with the value 'passed' during the function call.
25+
This function adds 7 to the value of its argument. Whenever we need to add 7 to some number we can reuse this same function over and over again.
26+
27+
During execution, the value of x in the function body (the part between the curly braces) is substituted with the value 'passed' during the function call.
2628

2729
A function thus is a reusable piece of code (see _Why Use Functions_ below). Functions are *very* important in JavaScript, to the extent that some people call JavaScript a "function-oriented" language. As mentioned above, variables can be of type function. In fact, *every function is a variable*.
2830

0 commit comments

Comments
 (0)