Sure, but be careful because JSON stringifys objects, which could result in data loss. It's quick and dirty and works but there are reasons not to.
I'm also not sure why @PGriffith didn't mention it, but if you install the Ignition Extensions module, there is a system.util.deepCopy() function that will do this as well.