30秒学会 Golang 片段 – Filter
Returns a new slice with all elements that pass the test implemented by the provided function. Imple...
Returns a new slice with all elements that pass the test implemented by the provided function. Imple...
Creates a hash for a value using the SHA-256 algorithm. Returns a promise. Use crypto API to create ...
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...