An alternative is to use this workaround - instead of registering the object:
console.log(objectVar)
You can assign the current state to an empty object, and then register it:
console.log(Object.assign({}, objectVar)) // works on all browsers // OR console.log({...objectVar}) // es6 only
Note: writing this is fast and tedious, so if you use the code editor (Atom / VScode), you can add it as a snippet
Here is an example snippet where you can simply type 'l' and press tab:
'.source.js': 'console.log object': 'prefix': 'l' 'body': "console.log('${1:variable}', Object.assign({}, ${1:variable}))"
OR for ES6:
'.source.js': 'console.log object': 'prefix': 'l' 'body': "console.log('${1:variable}', {...${1:variable}})"
kiwicopple
source share