Optimizes `toArray` for v8

len is unused, allocate array with new Array() and the correct length