#!/usr/local/bin/node newArray = (n) => { var a = Object.create(null); Object.setPrototypeOf(a, Array.prototype); a.length = n; return a; } console.log((newArray(2)).map) console.log((newArray(2)).map($=>"hello")) console.log(Array.from(newArray(2)).map($=>"hello"))