Flashcards
Methods and gotchas of the standard library: array methods, object utilities, Map and Set, strings, number precision, dates, JSON and modern syntax, with verified output questions.
slice vs splice
slice
splice
Tap to flip
arr.slice(start, end): returns a copy of a portion; does not change arr; end is exclusive
arr.slice(start, end)
arr
end
arr.splice(start, deleteCount, ...items): changes arr in place (removes/inserts) and returns the removed items
arr.splice(start, deleteCount, ...items)
Tap to see the front