0

In Javascript how to clone an object where one or more object properties point to a function ?

JSON.parse(JSON.stringify(object)) 

The above does not work because in the course of stringify it loses the reference to the function.

BaltoStar
  • 7,209
  • 13
  • 54
  • 80

1 Answers1

0

Try underscore library. The best solution to manipulate Array and Object.

var myCloneObject = _.clone(mySourceObject);

wawan
  • 497
  • 5
  • 10