Skip to content

Instantly share code, notes, and snippets.

@edieblu
Created April 24, 2020 13:02
Show Gist options
  • Save edieblu/a06e42a0fb8426baec50685ba98cd4f2 to your computer and use it in GitHub Desktop.
Save edieblu/a06e42a0fb8426baec50685ba98cd4f2 to your computer and use it in GitHub Desktop.
const text = 'Hi team :wave ! Espen , Jon and Eva are thrilled to have you back and working with us . VIBBIO 4ever :heart !'
const chopped = text.split(" ")
const Espen = [] // [ 'Hi', '!', 'Jon', 'are', 'have', 'and', 'us', '4ever' ] 
const Jon = [] // [ 'team', 'Espen', 'and', 'thrilled', 'you', 'working', '.', ':heart' ] 
const Eva = [] // [ ':wave', ',', 'Eva', 'to', 'back', 'with', 'VIBBIO', '!' ] 
for (let i = 0; i < chopped.length; i+=3) {
Espen.push(chopped[i])
Jon.push(chopped[i+1])
Eva.push(chopped[i+2])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment