30秒学会 JavaScript 片段 – times
Iterates over a callback n times Use Function.call() to call fn n times or until it returns false. O...
Iterates over a callback n times Use Function.call() to call fn n times or until it returns false. O...
Converts an integer to a list of digits. Use string interpolation to convert the integer to a string...
Returns the median of an array of numbers. Find the middle of the array, use sort() to sort the valu...
Creates a new array out of the two supplied by creating each possible pair from the arrays. Use Arra...
Returns true if the provided function returns true for all elements of an array, false otherwise. Us...
Returns every element that exists in any of the two lists once. Use the plus operator (+) to concate...
Encode a set of form elements as an object. Use the FormData constructor to convert the HTML form to...
Triggers a specific event on a given element, optionally passing custom data. Use new CustomEvent() ...
Makes a POST request to the passed URL. Use XMLHttpRequest web api to make a post request to the giv...
Creates a hash for a value using the SHA-256 algorithm. Returns a promise. Use the SubtleCrypto API ...