Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Created July 25, 2011 01:33
Show Gist options
  • Select an option

  • Save aaronpowell/1103374 to your computer and use it in GitHub Desktop.

Select an option

Save aaronpowell/1103374 to your computer and use it in GitHub Desktop.
Q3 - To array or not to array?
var array = ???
function print(x) {
var s = '';
for(var i = 0, il = x.length; i < il; i++) {
s += (' ' + x[i]);
}
console.log(s);
}
array[0] = 'does';
array[1] = 'this';
array[2] = 'work?';
print(array);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment