Day: 16
This code defines a new method called last on the prototype of the built-in Array class. This method returns the last element of the array on which it is called, or -1 if the array is empty.
#AlgorithmSeptember #WebDev #JavaScript #Algorithms @RebaseAcademy #30daysAlgo
Day: 14
This code defines a function called join(). This function takes two arrays as input, arr1 and arr2. The function first creates an empty object called result.
#AlgorithmSeptember #WebDev #JavaScript #Algorithms
@RebaseAcademy
#30daysAlgo
Day: 13
This code defines a new method called groupBy on the Array prototype. This method takes a function as an argument, and it groups the elements of the array by the results of the function.
#AlgorithmSeptember #WebDev #JavaScript #Algorithms
@RebaseAcademy
#30daysAlgo
Day: 12
This code defines an async function called promiseAll(). This function takes an array of functions as input and returns a promise that resolves with an array of the results of the functions.
#AlgorithmSeptember #WebDev #JavaScript #Algorithms
@RebaseAcademy
#30daysAlgo
Day: 11
The debounce function takes two arguments: a function fn and a time delay t in milliseconds.
#AlgorithmSeptember #WebDev #JavaScript #Algorithms @RebaseAcademy #30daysAlgo
The function timeLimit() takes two arguments: a function fn and a number t. The function fn is the function that we want to run with a time limit. The number t is the time limit in milliseconds.
#AlgorithmSeptember #WebDev #JavaScript #Algorithms
@RebaseAcademy
#30daysAlgo
Day: 10
The function backspaceCompare() takes two strings, s and t, as input and returns a boolean value indicating whether the two strings are equal after removing all the backspace characters.
#AlgorithmSeptember #WebDev #JavaScript #Algorithms @RebaseAcademy #30daysAlgo
Day: 9
This function takes an array of numbers as input and returns the maximum area of a rectangle in the histogram represented by the input array.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept
@RebaseAcademy
#30daysAlgo
Day: 8
This function takes an array of prices as input and returns the maximum profit that can be made by buying and selling a stock once.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept
@RebaseAcademy
#30daysAlgo
This code defines a function called cancellable. This function takes three arguments. #AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept
@RebaseAcademy
#30daysAlgo
Day: 7
The first function, memoize, takes a function as an argument and returns a new function that caches the results of the original function.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept
@RebaseAcademy
#30daysAlgo
The first function, cancellable(), takes three arguments: a function, an array of arguments, and a timeout in milliseconds.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept
@RebaseAcademy
#30daysAlgo
Day: 6
The sleep function takes a positive integer millis as input.
It then creates a Promise that resolves after millis milliseconds using the setTimeout function.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept @RebaseAcademy #30daysAlgo
This code defines a function called addTwoPromises(). This function takes two promises as its arguments.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept #RebaseAcademy #30daysAlgo
Day: 5
This code defines a function called once(). This function takes a function as its argument and returns a new function.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept #RebaseAcademy #30daysAlgo
The first function, argumentsLength, takes an arbitrary number of arguments as input and returns the number of arguments.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept #RebaseAcademy #30daysAlgo
Day: 4
The first function, compose, takes an array of functions as input and returns a new function.
#AlgorithmSeptember #WebDevelopment #JavaScript #Algorithms #Careerwise #AlgoSept #RebaseAcademy #30daysAlgo