Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Created June 16, 2013 10:18
Show Gist options
  • Select an option

  • Save hughfdjackson/5791618 to your computer and use it in GitHub Desktop.

Select an option

Save hughfdjackson/5791618 to your computer and use it in GitHub Desktop.
var dupEntry = function(array, index){
var head = array.slice(0, index)
var val = array[index]
var tail = array.slice(index + 1)
return head.concat([val, val]).concat(tail)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment