I want to split text which was provided by user into single characters and then edit them.
I used RegEx to divide whole sentence into words and then into characters, but finally I got array of arrays :/
Code (check console):
function showLetters() {
const simpleText = 'Hello my friends';
let words = simpleText.split(/\W+/),
letters = words.map(word => {
return word.match(/\S/g).join();
});
console.log(letters);
}
showLetters();
I want to know how can I get to this letters in finall array.
I beg for help, i'm newbie