Skip to content

Commit

Permalink
Update introduction.md
Browse files Browse the repository at this point in the history
Add a paragraph and example about storing a function's return value in a variable.
  • Loading branch information
JorensM authored Jul 31, 2024
1 parent 2b00cf9 commit 39ece5e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions exercises/concept/lasagna-master/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ function checkNumber(num) {
}
```

The return value of a function can be stored in a variable.

```javascript
function sum(x, y) {
return x + y;
}

const total = sum(5, 10);
// => 15
```

The result of a function that `return`s no value or does not have a `return` statement is `undefined`.
There are no implicit `return`s in JavaScript.

Expand Down

0 comments on commit 39ece5e

Please sign in to comment.