30秒学会 JavaScript 片段 – deepClone
Creates a deep clone of an object. Use recursion. Check if the passed object is null and, if so, ret...
Creates a deep clone of an object. Use recursion. Check if the passed object is null and, if so, ret...
Checks if the given argument is a native boolean element. Use typeof to check if a value is classifi...
Returns the highest index at which value should be inserted into array in order to maintain its sort...
Sets the value of a CSS rule for the specified HTML element. Use element.style to set the value of t...
Inserts an HTML string after the end of the specified element. Use el.insertAdjacentHTML() with a po...
Converts a 2D array to a comma-separated values (CSV) string. Use Array.prototype.map() and Array.pr...
Gets n random elements at unique keys from array up to the size of array. Shuffle the array using th...
Converts a string from camelcase. Use String.prototype.replace() to remove underscores, hyphens, and...
Escapes a string for use in HTML. Use String.prototype.replace() with a regexp that matches the char...
Returns a new MutationObserver and runs the provided callback for each mutation on the specified ele...