Skip to content

Instantly share code, notes, and snippets.

@JWPapi
Created September 25, 2020 21:20
Show Gist options
  • Select an option

  • Save JWPapi/c7e23aa511df5b06d47e867f54a1d784 to your computer and use it in GitHub Desktop.

Select an option

Save JWPapi/c7e23aa511df5b06d47e867f54a1d784 to your computer and use it in GitHub Desktop.
betSchema.virtual('toWin').get(function() {
return Number(this.backing/this.odds + this.backing/this.odds/this.odds).toFixed(2)
})
!==
betSchema.virtual('toWin').get(() => Number(this.backing/this.odds + this.backing/this.odds/this.odds).toFixed(2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment