Created
November 26, 2021 02:36
-
-
Save Segmentational/bd2ce672ee8507a59cbdfdce31a2813a to your computer and use it in GitHub Desktop.
Object Getters and Setters
This file contains hidden or 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
| import { Settings } from "./settings.js"; | |
| export const Test = { | |
| get example() { | |
| return Settings.attribute; | |
| }, | |
| set example(value) { | |
| Settings.attribute = value; | |
| }, | |
| get settings() { | |
| return Settings; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment