Skip to content

Instantly share code, notes, and snippets.

@Cinderella-Man
Last active April 11, 2017 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cinderella-Man/b5f7510cc70424c7ac18f6a4ef0f0dcc to your computer and use it in GitHub Desktop.
Save Cinderella-Man/b5f7510cc70424c7ac18f6a4ef0f0dcc to your computer and use it in GitHub Desktop.
Example of Javascript's equivalent of Scala's `case class`
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