Skip to content

Instantly share code, notes, and snippets.

@aseemk
Created May 5, 2011 21:26
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 aseemk/957996 to your computer and use it in GitHub Desktop.
Save aseemk/957996 to your computer and use it in GitHub Desktop.
Streamline v0.1.21 chokes on variables assigned inside a for-in loop that are defined outside.
var obj, key, val;
obj = {
foo: 'bar',
hello: 'world'
};
for (key in obj) {
val = obj[key];
setTimeout(_, 1000);
console.log('obj[' + key + '] = ' + val);
}
var obj, val;
obj = {
foo: 'bar',
hello: 'world'
};
for (var key in obj) {
val = obj[key];
setTimeout(_, 1000);
console.log('obj[' + key + '] = ' + val);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment