Nominally Patriotic Meathead
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    copyjspublic

    copyjs

    copyjs copyjs is for deep copies of javascript objects

    npm install copyjs
    
    var a = {
      val: 15,
      business: 'isGood'
    };
    
    var b = copy(a);
    
    #  object a { val: 15, business: 'isGood' }
    #  object b { val: 15, business: 'isGood' }
    
    b.val = 8000;
    b.business = 'isBetter';
    
    #  object a { val: 15, business: 'isGood' }
    #  object b { val: 8000, business: 'isBetter' }
    

    license: BSD

    notes: I would have used https://npmjs.org/package/copy but I couldn't find/see their source

    Keywords

    none

    install

    npm i copyjs

    Downloadsweekly downloads

    12

    version

    0.0.3

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar