30秒学会 JavaScript 片段 – curry
Curries a function. Use recursion. If the number of provided arguments (args) is sufficient, call th...
Curries a function. Use recursion. If the number of provided arguments (args) is sufficient, call th...
Calculates the factorial of an integer. Use recursion. If n is less than or equal to 1, return 1. Ot...
Returns the target value in a nested JSON object, based on the given key. Use the in operator to che...
Calculates the factorial of a number. Use recursion. If $n is less then or equal to 1, return 1. Oth...
Returns the least common multiple of two or more numbers. Define a gcd() function that determines th...
Calculates the factorial of a number. Use recursion. If n is less than or equal to 1, return 1. Othe...
Deep flattens an array. Use recursion. Use array_push, splat operator and an empty array to flatten ...
Generates all permutations of a string (contains duplicates). ⚠️ WARNING: This function’s exec...
Deep freezes an object. Use Object.keys() to get all the properties of the passed object, Array.prot...
Calculates the greatest common divisor between two or more numbers. Define a gcd() function for two ...