sCrypt-Inc / scryptTS-docs

https://docs.scrypt.io
12 stars 8 forks source link

When to shallow copy? #46

Closed xhliu closed 8 months ago

xhliu commented 1 year ago

Explain when, otherwise users do NOT know.

Sometimes, if you only want to do a shallow copy of some properties, you can pass in the property names as an optional argument like this:

let nextInstance = instance.next([‘prop1’, ‘prop2’]);

image

xhliu commented 1 year ago

What's the difference?

let nextInstance = instance.next();
// vs 
let nextInstance = instance;
yusufidimaina9989 commented 8 months ago

Done. https://github.com/sCrypt-Inc/scryptTS-docs/pull/231