To inherit properties of one object by another while dealing with JavaScript objects, I often see usage of _.clone
where the intention was to create an object with another object's properties and then it would be extended.
Why can't we just use _.extend
which is more relevant to extend an object?
Please tell me the difference between the two and why we can't _.extend
instead of _.clone
which is a costly operation.