For split string by space like in Python lang, can be used:
var w = "hello my brothers ;";
w.split(/(\s+)/).filter( function(e) { return e.trim().length > 0; } );
output:
["hello", "my", "brothers", ";"]
or similar:
w.split(/(\s+)/).filter( e => e.trim().length > 0)
(output some)