Created
December 29, 2018 22:14
-
-
Save kimschles/a3e288e8e0a50a468fd7a41d725a1da8 to your computer and use it in GitHub Desktop.
Example of JS constructor
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
| const isLeap = (year) => { | |
| class Year { | |
| constructor() { | |
| this.year = year | |
| } | |
| } | |
| let now = new Year(); | |
| return now.year | |
| }; | |
| console.log(isLeap(2018)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment