JS exam prep string manipulation