src/common.js
function replaceAt(items, item, index) {
  var copy = items.slice();
  copy.splice(index, 1, item);
  return copy;
}
function replaceAt(items, item, index) {
  var copy = items.slice();
  copy.splice(index, 1, item);
  return copy;
}
function replaceAt ( items , item , index ) { var copy = items . slice ( ) ; copy . splice ( index , 1 , item ) ; return copy ; }
Replace array element at given index with new item.
Doesn't modify source array.
@param {Array} items
@param {*} item
@param {Number} index
@return {Array}
Replace array element at given index with new item . Doesn t modify source array .