You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sampleArr: generate a random array of specified length
shuffleArr: shuffle an array
insert: insert an element after a specified index
(if the index is negative, it will insert from the end)
(recursive => it will insert the element on every index like)
//insert arr = [1,2,3,4,5], element = 0, index = 2 //output => [1,2,0,3,4,0,5] //insert arr = [1,2,3,4,5, 6], element = 0, index = 2 //output => [1,2,0,3,4,0,5,6,0] //when index is negative, it will start inserting from the end
remove: remove an element at a specified index (if the index is negative, it will remove from the end) index can be array of indexes
unique: remove duplicates from an array
rotate: rotate an array by a specified number of steps ie ([1,2,3,4,5], 2) => [3,4,5,1,2]
partition: partition an array into two arrays based on a condition
timeout: timeout a function after a specified amount of time ie timeout(f, 1000)(args) which will call f(args) and if it takes more than 1 second, it will return a timeout error
Date..
The text was updated successfully, but these errors were encountered:
Here are some ideas if you are searching for.
For Arrays
For Objects
Functional
Date..
The text was updated successfully, but these errors were encountered: