Skip to content

Instantly share code, notes, and snippets.

@tebriel
Created May 1, 2014 18:20
Show Gist options
  • Select an option

  • Save tebriel/4451751cd78bfb377e9e to your computer and use it in GitHub Desktop.

Select an option

Save tebriel/4451751cd78bfb377e9e to your computer and use it in GitHub Desktop.
> myarr = Array(20)
[ , , , , , , , , , , , , , , , , , , , ]
> for (var i=0; i<20; i+=3) {
... myarr[i] = 'taco';
... }
'taco'
> myarr
[ 'taco',
,
,
'taco',
,
,
'taco',
,
,
'taco',
,
,
'taco',
,
,
'taco',
,
,
'taco',
]
> myarr.forEach(function(item){console.log(item)})
taco
taco
taco
taco
taco
taco
taco
undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment