Skip to content

Instantly share code, notes, and snippets.

@ooflorent
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ooflorent/487945c50e94f6ba833f to your computer and use it in GitHub Desktop.
Save ooflorent/487945c50e94f6ba833f to your computer and use it in GitHub Desktop.
Questions about sparse arrays

Are the following arrays sparse?

Created using fixed length

var a = new Array(200)
a[50] = {}

Resized using length

var b = []
b.length = 200
b[50] = {}

Cloned from fixed-size array

var c = a.concat()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment