30秒学会 JavaScript 片段 – extendHex
Extends a 3-digit color code to a 6-digit color code. Use Array.prototype.map(), String.prototype.sp...
Extends a 3-digit color code to a 6-digit color code. Use Array.prototype.map(), String.prototype.sp...
Reverses a string. Use the spread operator (…) and Array.prototype.reverse() to reverse the order ...
Checks if a string is upper case. Convert the given string to upper case, using String.prototype.toU...
Returns true if the string is y/yes or false if the string is n/no. Use RegExp.test() to check if th...
Decodes a string of data which has been encoded using base-64 encoding. Create a Buffer for the give...
Convert tabs to spaces, where each tab corresponds to count spaces. Use String.prototype.replace() w...
Checks if a string is lower case. Use strings.ToLower() to convert the string to lower case and comp...
Converts a string to camelcase. Use re.sub() to replace any – or _ with a space, using the regexp r”...
Converts a string to snake case. Break the string into words and combine them adding _ as a separato...
Returns true if the given string is a palindrome, false otherwise. Use strings.Fields(), strings.Joi...