Skip to content

Instantly share code, notes, and snippets.

@HomenSimpsor
Last active August 29, 2015 14:21
Show Gist options
  • Save HomenSimpsor/56ab5d8889c1439aa845 to your computer and use it in GitHub Desktop.
Save HomenSimpsor/56ab5d8889c1439aa845 to your computer and use it in GitHub Desktop.
>>> a = [1, 2, 3, 4, 5]
>>> a.splice.apply(a, [2, 0].concat(['a','b']))
[]
>>> a
[1, 2, "a", "b", 3, 4, 5]
>>> a = [1, 2, 3, 4, 5]
>>> a.splice(2, 0, 'a')
[]
>>> a
[1, 2, "a", 3, 4, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment