30秒学会 JavaScript 片段 – Last date of month
Returns the string representation of the last date in the given date’s month. Use Date.prototy...
Returns the string representation of the last date in the given date’s month. Use Date.prototy...
Calculates the ranking of an array based on a comparator function. Use Array.prototype.map() and Arr...
Converts a RGB color tuple to HSB format. Use the RGB to HSB conversion formula to convert to the ap...
Converting strings to and from Base64 is a simple operation that might come in handy every once in a...
Function arity is the number of arguments a function expects. While it sounds very theoretical, it&#...
An Immediately Invoked Function Expression (IIFE for short) is a JavaScript function that is immedia...
Replaces the names of multiple object keys with the values provided. Use Object.keys() in combinatio...
Miles to kilometers In order to convert from miles to kilometers, you can use the conversion formula...
Finds the closest matching node starting at the given node. Use a for loop and Node.parentNode to tr...
Generates Gaussian (normally distributed) random numbers. Use the Box-Muller transform to generate r...