Created
May 1, 2020 08:07
-
-
Save housecricket/d21044ac0608dfb12328303ae96ae8ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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