Skip to content

Instantly share code, notes, and snippets.

@evantahler
Created May 19, 2011 04:54
Show Gist options
  • Save evantahler/980212 to your computer and use it in GitHub Desktop.
Save evantahler/980212 to your computer and use it in GitHub Desktop.
Chrome console.log note
///////////////
// Chrome Console wackyness
// It seems that objects that can be rendered to "Strings" (strings and numbers) will render with console.log
// However, obects that are "interpreted" graphically will be shown in the state they are at the conclusion of runtime (or whatever their state is when being viewed).
// Example:
var TestObject = new Object;
TestObject.name = "name 1";
console.log(TestObject) // will show the name attribue as "name 2" when viewed in chrome
console.log(TestObject.name) // will show "name 1" as expected
TestObject.name = "name 2";
console.log(TestObject) // will show the name attribue as "name 2" as expected
console.log(TestObject.name) // will show "name 2" as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment