30秒学会 JavaScript 片段 – compactWhitespace
Returns a string with whitespaces compacted. Use String.prototype.replace() with a regular expressio...
Returns a string with whitespaces compacted. Use String.prototype.replace() with a regular expressio...
Converts a NodeList to an array. Use spread operator inside new array to convert a NodeList to an ar...
Splits values into two groups according to a predicate function, which specifies which group an elem...
Converts the given array elements into <li> tags and appends them to the list of the given id....
Returns a list of elements that exist in both arrays. Create a Set from b, then use Array.prototype....
Returns the current URL without any parameters. Use String.prototype.indexOf() to check if the given...
Converts a number to an array of digits. Convert the number to a string, using the spread operator (...
Converts an array of objects to a comma-separated values (CSV) string that contains only the columns...
Returns an array of lines from the specified file. Use readFileSync function in fs node package to c...
Deep maps an object’s keys. Creates an object with the same values as the provided object and ...