Created
February 11, 2018 20:18
-
-
Save malte-j/8e8ee78b209f87a1286b5bf003e4ae23 to your computer and use it in GitHub Desktop.
Require Example
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
// JSON Objekt mit text Attribut | |
let data = { | |
text: "lorem ipsum" | |
} | |
// gibt den Text zurück | |
module.exports.getText = () => data.text; | |
// setzt den Text | |
module.exports.setText = newText => data.text = newText; |
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
let library = require('./library-example'); | |
// gibt den Text in der Konsole aus | |
console.log(library.getText()) |
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
let library = require('./library-example'); | |
library.setText('Beispieltext'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment