refactor(curriculum): JS Functions (#58407)

This commit is contained in:
Zaira 2025-02-06 02:14:56 +05:00 committed by GitHub
parent 205da31ac4
commit 59a5834040
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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--