Last Updated: February 25, 2016
·
831
· jcreigno

Fancy way to initialize an Array

Here is a way I found to initialize an array with values :

var initialized = Array.apply(null, new Array(size)).map(function () {
        return '132'; // initial element value
 });