// calls doSomething 42 times
Array( 42 ).join( "x" ).split( "" ).forEach( doSomething );
and
// creates 42 somethings
var somethings = Array( 42 ).join( "x" ).split( "" ).map( () => buildSomething(); );
or ( via https://stackoverflow.com/a/20066663/275501 )
Array.apply(null, {length: 42}).forEach( doSomething );