Use your console (F12 | Console)



Use window.clone for cloning

Typification:

window.clone<T>(object: T) => T

Example:

const obj = {key1: {key2: 'value'}}
const cloned = window.clone(obj);
cloned.key1.key2 = 'MODIFIED';
console.log('obj', obj);
console.log('cloned', cloned);

Use window.cloneTest for testing with logging

Typification:

cloneTest(testName: string, object: any, modifier?: (cloned: any) => void) => void

Example:

window.cloneTest('My test', {key1: {key2: 'value'}}, cloned => {
    cloned.key1.key2 = 'MODIFIED';
});