Selection and Transformation Flashcards

1
Q

Selection is…

A

picking some elements out of a collection depending on one or more criteria. For example, you might want to pick out all the odd numbers from an array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Transformation is…

A

manipulating every element in the collection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A callback is

A

A function expression provided to another function/method as an argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Object.keys(arr)

A
  • will only show the keys of SET elements. will not include elements which are unset but technically in the array. However it will show the keys of non element properties
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Array.Filter()

A

to perform the selection,filterexamines the return value of the callback on each iteration. It determines thetruthinessof the return value. There’s only one thing thatfiltercares about concerning the callback’s return value: whether it istruthyorfalsy. Note that truthy and falsy are not the same astrueandfalse.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Array.prototype.find

A

The find method also takes a callback function as an argument and returns the first element for which the callback function returns a truthy value:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Array.prototype.findIndex

A

findIndex is similar to find except it returns the index of the element for which the callback returns a truthy value:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly