JS Study Guide Cards Flashcards

1
Q

t/f primitive datatypes are immutable

A

true

variables can be assigned to a new value but existing values cannot be changed

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

const myDt = new Date();

A

today’s date and time

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

dt.setDate(myDt + 10);

A

increment to 10 days from today

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

dt = new Date(2008,12,30);

A

new date - 12/30/2008

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

concat

“manu”.concat(“facture”);

A

// manufacture

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

other string methods

A
includes
indexOf
charAt
match
replace

slice: The slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array. The original array will not be modified.

substring vs. substr: The arguments of substring() represent the starting and ending indexes, while the arguments of substr() represent the starting index and the number of characters to include in the returned string.

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

MAP

holds key/value pairs

A

map. set() - assigns value based on key
map. get() - get values based on key
map. has() = check existences

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