upTo(_ upBound: Int, callback: (Int) -> Void)

Invoke the callback with indexes from current int up to and including n.

Parameters

  • upBound: The up bound to go to.
  • callback: The block to invoke with current index.
1.upTo(3) { print($0) }
// Print 1,2,3