30秒学会 JavaScript 片段 – Hex to RGB
Converts a color code to an rgb() or rgba() string if alpha value is provided. Use bitwise right-shi...
Converts a color code to an rgb() or rgba() string if alpha value is provided. Use bitwise right-shi...
JavaScript provides a couple of ways to format numeric values to a given precision. Namely, you can ...
Array.prototype.slice() is a versatile tool in every JavaScript developer’s arsenal. It retrie...
Creates a promise that resolves after a given amount of time to the provided value. Use the Promise ...
Primitive values You can use Array.prototype.includes() to check if an array contains a primitive va...
Converts an object to a Map. Use Object.entries() to convert the object to an array of key-value pai...
Checks if a string contains only alphanumeric characters. Use RegExp.prototype.test() to check if th...
Converts an hsl() color string to an object with the values of each color. Use String.prototype.matc...
Creates a function that invokes fn with a given context, optionally prepending any additional suppli...
As discussed previously, you can use Array.prototype.includes() to check if an array includes a spec...