i += 1 vs i ++ vs i = i + 1

Edit on GitHub

Increment i in different ways

Setup

i = 0;

Tests

  • i += 1

    i += 1
  • i ++

    i++
  • i = i + 1

    i = i + 1