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

 Function Composition in JavaScript

 Function Composition in JavaScript Given an array of functions [f1, f2, f3, …, fn], return a new function fn that is the function composition of the array of functions. The function composition of [f(x), g(x), …

Read more

Array Reduce Transformation

Array Reduce Transformation Given an integer array nums, a reducer function fn, and an initial value init, return a reduced array. A reduced array is created by applying the following …

Read more

Filter Elements from Array

Filter Elements from Array Given an integer array arr and a filtering function fn, return a new array with a fewer or equal number of elements. The returned array …

Read more

Counter II in JavaScript

Write a function createCounter. It should accept an initial integer init. It should return an object with three functions. The three functions are: Example 1: …

Read more

Counter in JavaScript

Counter in JavaScript Given an integer n, return a counter function. This counter function initially returns n and then returns 1 more than the previous value every subsequent time it is …

Read more

2694. Event Emitter

2694. Event Emitter JavaScript Leetcode Problems Design an EventEmitter class. This interface is similar (but with some differences) to the one found in Node.js or the Event …

Read more

Skip to content