30秒学会 PHP 片段 – gcd
Calculates the greatest common divisor between two or more numbers. Use recursion. Use array_reduce(...
Calculates the greatest common divisor between two or more numbers. Use recursion. Use array_reduce(...
Inverts a dictionary with unique hashable values. Use dictionary.items() in combination with a list ...
Creates a dictionary with the same keys as the provided dictionary and values generated by running t...
Iterates over all own properties of an object in reverse, running a callback for each one. Use Objec...
Generates an array, containing the Fibonacci sequence, up until the nth term. Create an empty array,...
Capitalizes the first letter of every word in a string. Use String.prototype.replace() to match the ...
A hook that stores the previous state or props. Create a custom hook that takes a value. Use the Rea...
Replaces all but the last num runes of a string with the specified mask. Use String.substring() to g...
Maps the values of a list to a dictionary using a function, where the key-value pairs consist of the...
Returns a list of elements that exist in both arrays, using a provided comparator function. Use Arra...