re factored JS String Task 4