Last active
November 1, 2021 03:57
-
-
Save whynotavailable/2a7a8af3e928e9931cb0233fe5924729 to your computer and use it in GitHub Desktop.
example.js
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
| class Example { | |
| flip(text) { | |
| return [...text].reduce((previousValue, currentValue) => currentValue + previousValue, ''); | |
| } | |
| run(text) { | |
| return this.flip(padLeft(text)) | |
| function padLeft() { | |
| return '000' + text; | |
| } | |
| } | |
| } | |
| const example = new Example(); | |
| console.log(example.run('abc')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment