Update index.js changing [] instead of new Array()