Lecture 11 (ajax, string functions, classes) Flashcards

1
Q

promise

A
ex. fetch returns a promise
object representing the eventual completion or failure of an asynchronous operation
promise = new Promise(function(resolve, reject) {})
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what do we use to work with promises?

A

then and catch

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

ajax

A

asynchronous javascript and xml

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

asynchronous

A

happens in the background and the user can perform other actions on the page

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

are strings immutable

A

yes, and iterable

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

trim

A

removes white trailing and ending whitespace

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

toUpperCase, toLowerCase

A

self

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

substring

A

takes two indexes and return first argument and second argument - 1

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

split

A

takes an argument and splits the original string where that argument appears

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

includes

A

check if the string includes the argument

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

indexOf

A

returns the index of the argument

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

setInterval

A

calls a function at specified intervals

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

clearInterval

A

clears the interval

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

setTimeout

A

call a function after a specified duration

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

Date

A

object is used to work with dates and times
let d = new Date()
console.log(d.getFullYear()); // 2020

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

typeof

A

returns a string indicating the type of the unevaluated operand

17
Q

class

A
a class as data and the associated methods which act on it
- think of a class as template for creating objects/instances
18
Q

constructor

A

used for initialization of data/variables