JS Study Guide Cards Flashcards
t/f primitive datatypes are immutable
true
variables can be assigned to a new value but existing values cannot be changed
const myDt = new Date();
today’s date and time
dt.setDate(myDt + 10);
increment to 10 days from today
dt = new Date(2008,12,30);
new date - 12/30/2008
concat
“manu”.concat(“facture”);
// manufacture
other string methods
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.
MAP
holds key/value pairs
map. set() - assigns value based on key
map. get() - get values based on key
map. has() = check existences