30秒学会 JavaScript 片段 – mapNumRange
Maps a number from one range to another range. Returns num mapped between outMin–outMax from i...
Maps a number from one range to another range. Returns num mapped between outMin–outMax from i...
Determines if the current runtime environment is a browser so that front-end modules can run on the ...
Toggles a class for an HTML element. Use element.classList.toggle() to toggle the specified class fo...
Generates a UUID in a browser. Use crypto API to generate a UUID, compliant with RFC4122 version 4.
Checks if a string is lower case. Convert the given string to lower case, using String.toLowerCase()...
Normalizes line endings in a string. Use String.prototype.replace() and a regular expression to matc...
Take a number and return specified currency formatting. Use Intl.NumberFormat to enable country / cu...
Returns an array of n random integers in the specified range. Use Array.from() to create an empty ar...
Creates an array of key-value pair arrays from an object. Use Object.keys() and Array.prototype.map(...
Checks if the provided value is of the specified type. Ensure the value is not undefined or null usi...