code: function set(i, item, array)
  {
  	if (i < 0 || length(array) <= i)
  	{
  		return array;
  	}
  	return unsafeSet(i, item, array);
  }
docs: Sets the value at the index i. Only the nodes leading to i will get copied and updated.