30秒学会 JavaScript 片段 – maxN
Returns the n maximum elements from the provided array. If n is greater than or equal to the provide...
Returns the n maximum elements from the provided array. If n is greater than or equal to the provide...
Converts a string to camelcase. Use re.sub() to replace any – or _ with a space, using the regexp r”...
Returns the n minimum elements from the provided array. If n is greater than or equal to the provide...
Results in a string representation of tomorrow’s date. Use new Date() to get the current date,...
Converts an angle from radians to degrees. Use pi and the radian to degree formula to convert the an...
Renders a file drag and drop component for a single file. Create a ref called dropRef for this compo...
Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of e...
Returns a list of elements that exist in both lists, after applying the provided function to each el...
Calculates the factorial of a number. Use recursion. If n is less than or equal to 1, return 1. Othe...
Converts Fahrenheit to Celsius. Follows the conversion formula C = (F – 32) * 5/9.