Skip to content

Instantly share code, notes, and snippets.

@riston
Created August 26, 2014 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riston/a4e8ff89f18648e5b43c to your computer and use it in GitHub Desktop.
Save riston/a4e8ff89f18648e5b43c to your computer and use it in GitHub Desktop.
Immutable origin array
var a = [1,2,3]
// Using lodash or underscore
var b = _.clone(a);
var c = Array.prototype.slice.call(a, 0);
var d = a.concat()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment