Polyfill for Array.prototype.reduce
Write a polyfill for Array.prototype.reduce in JavaScript and take care of all edge cases below, πArray.prototype.reduce π’ Easy π§© Pattern β JavaScript Essentials JavaScript Reduce Polyfill
Write a polyfill for Array.prototype.reduce in JavaScript and take care of all edge cases below, πArray.prototype.reduce π’ Easy π§© Pattern β JavaScript Essentials JavaScript Reduce Polyfill
Write a debounce function with a cancel() method to clear any pending calls and flush() to call the function immediately clear by clearing the last timer. πDebounce π‘ Medium π§© Pattern β JavaScript Essentials What is debouncing? Debouncing is a technique that ensures that a function is called only after… Read More »Debounce with flush and cancel
πLC9 π’ Easy π§© Pattern β math logic Given an integer x, return true if x is a PALINDROME, and false otherwise. Follow up: Could you solve it without converting the integer to a string? Example Solution
πLC3024 π’ Easy π§© Pattern β Array, math logic You are given a 0-indexed integer array nums of size 3 which can form the sides of a triangle. Return a string representing the type of triangle that can be formed or “none” if it cannot form a triangle. Example Solution… Read More »Type of Triangle – 3024
πLC2648 π’ Easy π§© Pattern β Generator Functions Write a generator function that returns a generator object which yields the Fibonacci sequence. The Fibonacci sequence is defined by the relation Xn = Xn-1 + Xn-2. The first few numbers of the series are 0, 1, 1, 2, 3, 5, 8, 13. Example Solution
Given an object, create a deep clone of it. This is a common interview question, and we are advised not to use any built-in methods to solve this problem. π‘ Medium π§© Pattern β Objects Drawbacks of other methods structuredClone is the way β The structuredClone() method of the Window… Read More »Deep Clone an Object in JavaScript