Last active
April 11, 2017 07:47
-
-
Save Cinderella-Man/b5f7510cc70424c7ac18f6a4ef0f0dcc to your computer and use it in GitHub Desktop.
Example of Javascript's equivalent of Scala's `case class`
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
function Abc(userId, id, title, body) { | |
return new Abc(userId, id, title, body) | |
} | |
class Abc { | |
constructor(userId, id, title, body) { | |
this.userId = userId | |
this.id = id | |
this.title = title | |
this.body = body | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment