30秒学会 JavaScript 片段 – Hash string into number
Hashes the input string into a whole number. Use String.prototype.split() and Array.prototype.reduce...
Hashes the input string into a whole number. Use String.prototype.split() and Array.prototype.reduce...
Displays the link URL for links with no text. Use the :empty pseudo-class to select links with no te...
Exact string match Use the ^ and $ anchors to match the start and end of the string, respectively. A...
The short answer Most often than not, window.location.reload() is all you need to reload the current...
Replaces the last occurrence of a pattern in a string. Use typeof to determine if pattern is a strin...
Creates a shake animation on invalid input. Use the pattern attribute to define the regular expressi...
Executes a callback whenever the window is resized. Use the useRef() hook to create a variable, list...
Spread operator The spread operator (…) was introduced in ES6 and can be used to merge two or more...
Checks if the elements of the first list are contained in the second one regardless of order. Use co...
Converts a string to a URL-friendly slug. Use str.lower() and str.strip() to normalize the input str...