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...
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...
Spread operator The spread operator (…) was introduced in ES6 and can be used to merge two or more...
Returns all the elements of an array except the last one. Use Array.prototype.slice() to return all ...
Creates an object with the unique values of an array as keys and their frequencies as the values. Us...
Oftentimes, especially when creating password inputs, you need to check if the Caps Lock key is on a...
Closures are a JavaScript concept that comes up quite a lot, especially during interviews. While the...
You can’t get too far in web development without stumbling upon a situation where you have to ...