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
});
Written by jerome creignou
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#