Skip to content

Commit 4b1f1ac

Browse files
chore(curriculum): replace question in JS Higher Order Functions Quiz (freeCodeCamp#61280)
Co-authored-by: Huyen Nguyen <[email protected]>
1 parent fda8163 commit 4b1f1ac

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

curriculum/challenges/english/25-front-end-development/quiz-javascript-higher-order-functions/66edcdd18a4ef8df16e6bb7e.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -409,31 +409,28 @@ filteredArray[0].id = 4;
409409

410410
#### --text--
411411

412-
What would be the output of the following code?
412+
What will be the value of `shortWords` after the following code is run?
413413

414414
```js
415-
const multiply = (a) => (b) => a * b;
416-
const operations = [multiply(2), multiply(3)];
417-
const result = operations.reduce((acc, fn) => fn(acc), 5);
418-
419-
console.log(result);
415+
const words = ['apple', 'banana', 'pear', 'kiwi'];
416+
const shortWords = words.filter(word => word.length <= 5);
420417
```
421418

422419
#### --distractors--
423420

424-
`10`
421+
`[]`
425422

426423
---
427424

428-
`100`
425+
`['pear', 'kiwi']`
429426

430427
---
431428

432-
`20`
429+
`['apple', 'banana']`
433430

434431
#### --answer--
435432

436-
`30`
433+
`['apple', 'pear', 'kiwi']`
437434

438435
### --question--
439436

0 commit comments

Comments
 (0)