30秒学会 JavaScript 片段 – objectToEntries
Creates an array of key-value pair arrays from an object. Use Object.keys() and Array.prototype.map(...
Creates an array of key-value pair arrays from an object. Use Object.keys() and Array.prototype.map(...
Converts a string to a URL-friendly slug. Uses preg_replace() to replace invalid chars with dashes, ...
Deep flattens an array. Use recursion. Use array_push, splat operator and an empty array to flatten ...
Checks if the provided value is of the specified type. Ensure the value is not undefined or null usi...
Returns the value of the last element in the provided collection that satisfies the provided testing...
Generates all permutations of a string (contains duplicates). ⚠️ WARNING: This function’s exec...
Returns the maximum of the given dates. Use the ES6 spread syntax with Math.max to find the maximum ...
Capitalizes the first letter of a string. Use String.toUpperCase() to capitalize first letter and St...
While the best way of reusing your code is creating a component, it’s also possible to do it i...
Checks if the given argument is a string. Only works for string primitives. Use typeof to check if a...