replace method

$R replace(
  1. int index,
  2. $T v
)

Implementation

$R replace(int index, $T v) => splice(index, 1, [v]);