30秒学会 JavaScript 片段 – Collection is empty
Checks if the a value is an empty object/collection, has no enumerable properties or is any type tha...
Checks if the a value is an empty object/collection, has no enumerable properties or is any type tha...
Converts the values of RGB components to a hexadecimal color code. Create a placeholder for a zero-p...
Formats a number using the local number format order. Use Number.prototype.toLocaleString() to conve...
Sometimes, one might run into the problem of converting the string representation of a value into th...
Converts a string to a URL-friendly slug. Use String.prototype.toLowerCase() and String.prototype.tr...
Splits a multiline string into an array of lines. Use String.prototype.split() and a regular express...
Escapes a string for use in HTML. Use String.prototype.replace() with a regexp that matches the char...
Pads a string on both sides with the specified character, if it’s shorter than the specified l...
Definition The Caesar cipher is a simple substitution cipher, in which each letter is replaced by an...
JavaScript ES6 introduced, among many other things, the spread operator (…), which allows an itera...