Flatten Deeply Nested Array

Flatten Deeply Nested Array Given a multi-dimensional array arr and a depth n, return a flattened version of that array. A multi-dimensional array is a recursive data structure that contains integers or other multi-dimensional arrays. …

Read more

Chunk Array in JavaScript

Chunk Array in JavaScript Given an array arr and a chunk size size, return a chunked array. A chunked array contains the original elements in arr, but consists of subarrays each of length size. …

Read more

Debounce in JavaScript

Debounce in JavaScript Given a function fn and a time in milliseconds t, return a debounced version of that function. A debounced function is a function whose execution is delayed by t milliseconds …

Read more

Promise Time Limit in JavaScript

Promise Time Limit in JavaScript Given an asyncronous function fn and a time t in milliseconds, return a new time limited version of the input function. A time limited function is a function …

Read more

Sleep in JavaScript

Sleep in JavaScript Given a positive integer millis, write an asyncronous function that sleeps for millis milliseconds. It can resolve any value. Example 1: Input: millis = 100 …

Read more

Curry in JavaScript

Curry in JavaScript Given a function fn, return a curried version of that function. A curried function is a function that accepts fewer or an equal number of parameters as the …

Read more

Memoize in JavaScript

Memoize in JavaScript Given a function fn, return a memoized version of that function. A memoized function is a function that will never be called twice with the same …

Read more

Allow One Function Call

Allow One Function Call Given a function fn, return a new function that is identical to the original function except that it ensures fn is called at …

Read more

Skip to content