refactor(curriculum): JS Functions (#58407)

This commit is contained in:
Zaira
2025-02-05 13:14:56 -08:00
committed by GitHub
parent 205da31ac4
commit 59a5834040
@@ -146,35 +146,49 @@ Pay attention to the default parameter and how many arguments are passed to the
## --text--
Which statement about functions in JavaScript is true?
Which of the following is the correct way to call (or invoke) the `sum` function?
```js
function sum(num1, num2) {
return num1 + num2
}
```
## --answers--
Functions always need to have a `return` statement.
```js
()sum>
```
### --feedback--
Think about the special properties of functions in JavaScript that we discussed.
Review the first minute of the video where function calls were discussed.
---
Functions can only return one value.
```js
()sum()
```
### --feedback--
Think about the special properties of functions in JavaScript that we discussed.
Review the first minute of the video where function calls were discussed.
---
Functions are first-class objects in JavaScript.
```js
sum()
```
---
Functions cannot be passed as arguments to other functions.
```js
<sum>
```
### --feedback--
Think about the special properties of functions in JavaScript that we discussed.
Review the first minute of the video where function calls were discussed.
## --video-solution--