Software engineer with 4+ years of experience in building products for numerous domains like fin-tech, real estate, video streaming, retail, and now e-commerce.
There is a cool library available for cloning objects efficiently called rfdc (Really Fast Deep Clone).
constclone=require("rfdc")();constuser={id:1,name:"Leanne Graham",username:"Bret",email:"Sincere@april.biz",phone:"1-770-736-8031 x56442",website:"hildegard.org",company:{name:"Romaguera-Crona",catchPhrase:"Multi-layered client-server neural-net",bs:"harness real-time e-markets",},};constnextUser=clone(user);console.log(user===nextUser);// This will return false because object have differnt reference.
Thanks for such a cool suggestion.
Infact after your comment, I have looked into it and its comparision with other libraries. I think it's very efficient.
Software engineer with 4+ years of experience in building products for numerous domains like fin-tech, real estate, video streaming, retail, and now e-commerce.
The great thing about rfdc is that it super quickly clones real objects with cycles/functions/constructors etc. It is super quick at that.
If you need to quick clone something including enumerable properties but NOT any of that cool stuff rfdc does - then I use this that is a little quicker if you know that there won't be issues:
Software engineer with 4+ years of experience in building products for numerous domains like fin-tech, real estate, video streaming, retail, and now e-commerce.
Software engineer with 4+ years of experience in building products for numerous domains like fin-tech, real estate, video streaming, retail, and now e-commerce.
There is a cool library available for cloning objects efficiently called rfdc (Really Fast Deep Clone).
Thanks for such a cool suggestion.
Infact after your comment, I have looked into it and its comparision with other libraries. I think it's very efficient.
👍🏻
The great thing about rfdc is that it super quickly clones real objects with cycles/functions/constructors etc. It is super quick at that.
If you need to quick clone something including enumerable properties but NOT any of that cool stuff rfdc does - then I use this that is a little quicker if you know that there won't be issues:
Thanks, Mike for sharing this.
Thanks for sharing!
looks good 👍🏻