Javascript: Clone array/object.

PHOTO EMBED

Mon Aug 29 2022 16:59:01 GMT+0000 (UTC)

Saved by @marcopinero #javascript

function clone(src) {
	if(!src) return null;
	return JSON.parse(JSON.stringify(src));
}
content_copyCOPY

Let clone array or object (unreferenced copy).