Skip to content

Instantly share code, notes, and snippets.

@jesperlandberg
Created February 24, 2017 18:59
Show Gist options
  • Save jesperlandberg/4502430cc685a5f558561ce0da2463d5 to your computer and use it in GitHub Desktop.
Save jesperlandberg/4502430cc685a5f558561ce0da2463d5 to your computer and use it in GitHub Desktop.
this.current == (this.total - 1) ? (this.current = 0 && this.prev = (this.total - 1)) : (this.current += 1 && this.prev = (this.current - 1))
if(this.current == (this.total - 1)) {
this.current = 0
this.prev = (this.total - 1)
} else {
this.current += 1
this.prev = (this.current - 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment