How would you go around to collect the first letter of each word in a string, as in to receive an abbreviation?
Input: "Java Script Object
This is made very simple with ES6
string.split(' ').map(i => i.charAt(0)) //Inherit case of each letter
string.split(' ').map(i => i.charAt(0)).toUpperCase() //Uppercase each letter
string.split(' ').map(i => i.charAt(0)).toLowerCase() //lowercase each letter
This ONLY works with spaces or whatever is defined in the .split(' ')
method
ie, .split(', ')
.split('; ')
, etc..