I am trying to use reduce to get the following output:

```
solution('abcdef') // should return ['ab', 'cd', 'ef']

```

if the length of the string is odd we should convert it into even and add a '\_'(underscore)

```
solution('abc') // should return ['ab', 'c_'] 

```

here is where I am so far:

1. my if function is not working, not really sure why.
2. I only get till 2 strings but cant go beyond those. I think I am forcing the result to become what I want but this wont work in case we only have 1 character or 2 right?

```js
function solution(str){
 if (str.lenght % 2!==0){str.concat('_')};
 console.log(str)
 const array =  str.split(',');

  const reducer = array.reduce((acc, curr, i, arr)=>{
    return [...acc, curr[i]+curr[i+1], curr[i+2]+curr[i+3]]
  },[])

  return reducer
}

solution('helloworl')
```

any hints and recommendations on how to face the problem would be nice!
thanks a lot