Get a character after a space

Hello, I would like to get the word after " " in this sentence:

Hello world, this is a test!

SO, I WOULD LIKE TO TAKE THE WORD FOLLOWING EACH SPACES IN AN ARRAY!
EXAMPLE:
var words = [“Hello” , “World” , “,” , “this” , “is” , “a” , “test”];

THANK YOU!

Split lets you easily do that.

var words = "Hello world, this is a test!".split(" ");
// ["Hello", "world,", "this", "is", "a", "test!"]
1 Like

Thank you very much! it was a really good answer!
Bye

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.