javascript split on space when at certain length code example Example: js split text on spaces var string = "text to split"; var words = string.split(" ");