Create New Array From Existing Javascript Function