Zoic JS methods Flashcards

1
Q

Array.reduce()

A

Must create a callback function to use with it. Is able to reduce an array of numbers based on the callback function used with it. (previousValue and currentValue)

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

String.includes()

A

Checks whether one string is found in the string it’s called on. Returns true or false.

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

Array.entries()

A

Returns a new array iterator that contains a key/value pair for each index of the array.

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

Object.keys()

A

Method that returns an array of the object.

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

Array.forEach()

A

Method that executes a provided function once for each array element.
array.forEach(element => console.log(element))

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

Object.assign()

A

Method that copies all properties from one or more source objects and modifies the target object. Returns the modified target object.

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

Array.from()

A

Method that creates a new array instance of the array or string.

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

Array.reverse()

A

Method that reverses an array. The first array element becomes the last, the last array element becomes the first.

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

Array.join()

A

Method that creates and returns a new string by concatenating all of the elements in an array. join() or join(separator)

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

Document.createElement

A
Method that creates the HTML element by tagName.
let element = document.createElement(tagName)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Node.textContent

A

document.getElementById(tagName).textContent = ‘text’

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

element.appendChild()

A

Allows an element to be appended to a parent element.

element.appendChild(child element)

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

HTMLElement.style

A

Returns the inline style of the element in the form of a CSS Style Declaration object.
style = element.style

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

HTML DOM changing CSS

A

document.getElementById(id).style.color = “blue”

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