how to split string using indexof in javascript code example Example: js split string at index "How are you?".slice(8, 11); /*Output: you*/