https://www.fwait.com/how-to-copy-an...in-javascript/