Skip to content

CarlMungazi/simple-deep-copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-deep-copy

Deep copy objects and arrays

Make a simple deep copy of an array or object. This will not work on dates, regexes and potentially other types of objects. If you want something which covers everything, use this

Install

$ npm install simple-deep-copy

Usage

const simpleDeepCopy = require('simple-deep-copy');

const originalArray = [
  { lang: "JavaScript" },
  { lang: "Elm" },
  { lang: "Rust" }
];
const newArray = simpleDeepCopy(originalArray);

newArray[1].lang = "Elixir"
//=> 'Elixir'

originalArray[1].lang
//=> 'Elm'

License

MIT © Carl Mungazi

About

Deep copy objects and arrays

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published