simple-deep-copy

0.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i simple-deep-copy

Weekly Downloads

1

Version

0.0.0

License

MIT

Unpacked Size

3.57 kB

Total Files

5

Last publish

Collaborators

  • carlmungazi