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.
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.
Try underscore library. The best solution to manipulate Array and Object.
var myCloneObject = _.clone(mySourceObject);