EatTheBlocks Forum

Split method in javascript


Do you know what is the exact purpose of “split(’,’)” in javascript?
In a javascript simulator I saw that it returns the exact array we put in argument so i don’t understand the purpose of “split(’,’)”.

Thank you

Take care


It allows to split a string in an array. Example. “word1, word2, word3”.split(’,’) will be split on comma (","), and will result in this array: [word1, word2, word3]

Thank you so much Julien :slight_smile:

1 Like