Skip to content

Instantly share code, notes, and snippets.

@housecricket
Created May 1, 2020 08:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save housecricket/d21044ac0608dfb12328303ae96ae8ce to your computer and use it in GitHub Desktop.
Save housecricket/d21044ac0608dfb12328303ae96ae8ce to your computer and use it in GitHub Desktop.
var square = {}
(function() {
var length = 0, width = 0
Object.defineProperty(square, "length", {
get: function() { return length },
set: function(value) { length = width = value }
})
Object.defineProperty(square, "width", {
get: function() { return width },
set: function(value) { length = width = value }
})
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment