Skip to content

Instantly share code, notes, and snippets.

@rmosolgo
Created January 17, 2014 00:52
Show Gist options
  • Save rmosolgo/8466476 to your computer and use it in GitHub Desktop.
Save rmosolgo/8466476 to your computer and use it in GitHub Desktop.
Be careful with prototype properties in JS when you change them
class Tophat
dimensions: {height: 50, circumference: 20}
color: "black"
tpains_hat = new Tophat
tpains_hat.dimensions.height = 120
tpains_hat.color = "#f59145"
lincolns_hat = new Tophat
console.log lincolns_hat.color # => "black"
console.log lincolns_hat.dimensions.height # => 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment