Skip to content

Instantly share code, notes, and snippets.

@cassiozen
Created August 24, 2015 19:13
Show Gist options
  • Save cassiozen/22936a2c5fc06a363f6b to your computer and use it in GitHub Desktop.
Save cassiozen/22936a2c5fc06a363f6b to your computer and use it in GitHub Desktop.
// updatedTicket is a new object with the original properties of this.state.ticket
// merged with the new flightNo.
var updatedTicket = Object.assign({}, this.state.ticket, {flightNo:'1010'});
this.setState({ticket:updatedTicket});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment