Created
November 11, 2017 22:47
-
-
Save chrispsn/b0b717348c437fcb282a5f277bb9c3ac to your computer and use it in GitHub Desktop.
Is there a way to allow branches of a nested object to look at other branches of the parent?
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
'use strict'; | |
module.exports = (function() { | |
// It would be good to get rid of the my_module declaration entirely | |
const my_module = { | |
a: 'abc', | |
get b() {return 123}, | |
get c() {return my_module.a}, | |
get c2() {return this.a}, | |
get d() {return { | |
e: [1, 2], | |
get f() {return my_module.d.e}, | |
get f2() {return this.e}, | |
get g() {return my_module.a}, | |
}}, | |
}; | |
return my_module; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment