Javascript - createArray