You are mapping answers and then in your code you have input.answer from the start.
Just put Array.from(input)