js split all whitespace code example Example: split by whitespace javascript var text = "hoi how are you"; var arr = text.split(/\s+/);