Skip to content

Instantly share code, notes, and snippets.

@rnicholus
Created April 8, 2016 15:24
Show Gist options
  • Save rnicholus/14c5e0fa3019c87be5547a32bfe384c0 to your computer and use it in GitHub Desktop.
Save rnicholus/14c5e0fa3019c87be5547a32bfe384c0 to your computer and use it in GitHub Desktop.

My thought has always been: 3 method parameters is too many. So, the following method call:

sayHi(this.props.firstname, this.props.lastnane this.state.message)

...to this:

sayHi({
   firstName: this.props.firstname,
   lastname: this.props.lastname,
   message: this.state.message
})

And the actual function signature would change from:

function sayHi(firstname, lastname, message)

...to:

function sayHi({firstname, lastname, message})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment