From 1d88d4431d39c64ecacd26efd7ff0a429c86c1f4 Mon Sep 17 00:00:00 2001
From: Pl4gue Utility
coalesce
@@ -1137,14 +1137,6 @@ Combine characters to get a string using join('').
Converts a given string into an array of words.
-Use String.split() with a supplied pattern (defaults to non alpha as a regex) to convert to an array of strings. Use Array.filter() to remove any empty strings.
-Omit the second argument to use the default regex.
const stringToArrayOfWords = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean);
-// stringToArrayOfWords("I love javaScript!!") -> ["I", "love", "javaScript"]
-// stringToArrayOfWords("python, javaScript & coffee") -> ["python", "javaScript", "coffee"]
-
Converts a string to camelcase.
Use replace() to remove underscores, hyphens and spaces and convert words to camelcase.
... appende
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
// truncateString('boomerang', 7) -> 'boom...'
+Converts a given string into an array of words.
+Use String.split() with a supplied pattern (defaults to non alpha as a regex) to convert to an array of strings. Use Array.filter() to remove any empty strings.
+Omit the second argument to use the default regex.
const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean);
+// words("I love javaScript!!") -> ["I", "love", "javaScript"]
+// words("python, javaScript & coffee") -> ["python", "javaScript", "coffee"]
+
Returns the first non-null/undefined argument.