cmda-bt / cmda-bt/fe-course-20-21

Chapter 5 Summary

Open
#89 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
30
Forks
2
PR merge metrics
No merged PRs in 30d

Description

# Chapter 5: Higher Order functions
## Abstraction
In programming there are pieces of code, usually methods, that does a lot more in the background which you don't see. This shortens the length of the code and doesn't show all the details (it becomes more abstract).

## Filtering arrays
`filter()` is a function that filters out all the items in an array that don't pass a test and keeps the items that do pass and adds it to a new array.

## Transforming with map
`map()` is a function that creates another array from the given array with the given function. Every element of the given array goes through the function, the value that returns is then put in the same index in the new array.

## Summarizing with reduce
`reduce()` is a function that accumulates all number values within an array, a second parameter is optional and adds another number on the accumulated array.

## Strings and character codes
`some()` is a function puts every array element into another given function and returns `true` if the function returns `true` on any of the array elements.

`charCodeAt()` is a function that returns an integer that represents the UTF-16 code unit from the character that is put in the function. If the character is not represented with a single UTF-16 code unit it returns the half-character.

`codePointAt()` is a function that returns an integer that represents the full code unit of a character (beyond the limits of UTF-16).

## Recognizing text
`findIndex()` is a function puts every array element into another given function and returns the index number of first the array element for which the given function returns `true`.

### Resource:
Haverbeke, M. (2018a). Higher-Order Functions :: Eloquent JavaScript. Eloquentjavascript.Net. https://eloquentjavascript.net/05_higher_order.html

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue supplies proposed content for a Chapter 5 summary but does not identify a target file or the requested repository change. First locate the Chapter 5 course material, then compare its treatment of abstraction, array methods, strings, and character codes with this text. Done means the intended summary location and required edits are confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.