30秒学会 JavaScript 片段 – capitalize
Capitalizes the first letter of a string. Use array destructuring and String.prototype.toUpperCase()...
Capitalizes the first letter of a string. Use array destructuring and String.prototype.toUpperCase()...
Sorts a collection of arrays or objects by key. Uses sort() on the provided array to sort the array ...
Filters a collection keeping up to n occurences of each value. Use IEnumerable.Distinct() in combina...
A hook that returns a value based on a media query. Check if window and window.matchMedia exist, ret...
Returns true if all elements in the collection pass the test implemented by the provided function, f...
Redirects the page to HTTPS if its currently in HTTP. Also, pressing the back button doesn’t t...
Copy a string to the clipboard. Only works as a result of user action (i.e. inside a click event lis...
Creates a function that accepts up to n arguments, ignoring any additional arguments. Call the provi...
Returns all elements in a list except for the first one. Return lst[1:] if the list’s length i...
Makes the first letter in the first paragraph bigger than the rest of the text – often used to...