Split String By Character Javascript Interviewbit