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
  • 8,165
  • 17
  • 59
  • 91

1 Answers1

0

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

var myCloneObject = _.clone(mySourceObject);

wawan
  • 497
  • 6
  • 11