diff --git a/src/operators/toArray.ts b/src/operators/toArray.ts index 3b11ffe27d..2148ad3e80 100644 --- a/src/operators/toArray.ts +++ b/src/operators/toArray.ts @@ -2,6 +2,9 @@ import { reduce } from './reduce'; import { OperatorFunction } from '../interfaces'; function toArrayReducer(arr: T[], item: T, index: number) { + if (index === 0) { + return [item]; + } arr.push(item); return arr; }